mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-27 23:01:55 +00:00
Split InfoString classes into multiple files depending on loading and writing code
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
#include "InfoStringToStructConverter.h"
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
void InfoStringToStructConverter::FillStructure()
|
||||
{
|
||||
}
|
||||
|
||||
InfoStringToStructConverter::InfoStringToStructConverter(const InfoString& infoString, void* structure,
|
||||
const cspField_t* fields, const size_t fieldCount)
|
||||
: InfoStringToStructConverterBase(infoString, structure),
|
||||
m_fields(fields),
|
||||
m_field_count(fieldCount)
|
||||
{
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "InfoString/InfoStringToStructConverterBase.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class InfoStringToStructConverter : public InfoStringToStructConverterBase
|
||||
{
|
||||
const cspField_t* m_fields;
|
||||
size_t m_field_count;
|
||||
|
||||
protected:
|
||||
void FillStructure() override;
|
||||
|
||||
public:
|
||||
InfoStringToStructConverter(const InfoString& infoString, void* structure, const cspField_t* fields, size_t fieldCount);
|
||||
};
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#include "InfoStringToStructConverter.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
void InfoStringToStructConverter::FillStructure()
|
||||
{
|
||||
}
|
||||
|
||||
InfoStringToStructConverter::InfoStringToStructConverter(const InfoString& infoString, void* structure,
|
||||
const cspField_t* fields, const size_t fieldCount)
|
||||
: InfoStringToStructConverterBase(infoString, structure),
|
||||
m_fields(fields),
|
||||
m_field_count(fieldCount)
|
||||
{
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "InfoString/InfoStringToStructConverterBase.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6
|
||||
{
|
||||
class InfoStringToStructConverter : public InfoStringToStructConverterBase
|
||||
{
|
||||
const cspField_t* m_fields;
|
||||
size_t m_field_count;
|
||||
|
||||
protected:
|
||||
void FillStructure() override;
|
||||
|
||||
public:
|
||||
InfoStringToStructConverter(const InfoString& infoString, void* structure, const cspField_t* fields, size_t fieldCount);
|
||||
};
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
#include "InfoStringToStructConverterBase.h"
|
||||
|
||||
InfoStringToStructConverterBase::InfoStringToStructConverterBase(const InfoString& infoString, void* structure)
|
||||
: m_info_string(infoString),
|
||||
m_structure(structure)
|
||||
{
|
||||
}
|
||||
|
||||
InfoStringToStructConverterBase::~InfoStringToStructConverterBase()
|
||||
= default;
|
||||
|
||||
void InfoStringToStructConverterBase::Convert()
|
||||
{
|
||||
FillStructure();
|
||||
}
|
22
src/ObjLoading/InfoString/InfoStringToStructConverterBase.h
Normal file
22
src/ObjLoading/InfoString/InfoStringToStructConverterBase.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
class InfoStringToStructConverterBase
|
||||
{
|
||||
protected:
|
||||
const InfoString& m_info_string;
|
||||
void* m_structure;
|
||||
|
||||
virtual void FillStructure() = 0;
|
||||
|
||||
public:
|
||||
InfoStringToStructConverterBase(const InfoString& infoString, void* structure);
|
||||
virtual ~InfoStringToStructConverterBase();
|
||||
InfoStringToStructConverterBase(const InfoStringToStructConverterBase& other) = delete;
|
||||
InfoStringToStructConverterBase(InfoStringToStructConverterBase&& other) noexcept = delete;
|
||||
InfoStringToStructConverterBase& operator=(const InfoStringToStructConverterBase& other) = delete;
|
||||
InfoStringToStructConverterBase& operator=(InfoStringToStructConverterBase&& other) noexcept = delete;
|
||||
|
||||
void Convert();
|
||||
};
|
Reference in New Issue
Block a user