libcmo21/LibCmo/CKObjects.hpp

245 lines
6.8 KiB
C++
Raw Normal View History

2023-02-26 21:48:03 +08:00
#pragma once
#include "CKDefines.hpp"
#include "CKEnums.hpp"
namespace LibCmo::CK2::CKObjectImplements {
class CKObject {
public:
2023-02-28 14:04:38 +08:00
CK_ID m_ID;
std::string m_Name;
CK_OBJECT_FLAGS m_ObjectFlags;
CKMinContext* m_Context;
2023-02-27 22:23:05 +08:00
CKObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKObject(const CKObject&) = delete;
CKObject& operator=(const CKObject&) = delete;
virtual ~CKObject();
CK_ID GetID(void) { return this->m_ID; }
2023-02-28 14:04:38 +08:00
CKSTRING GetName(void) { return (this->m_Name.empty() ? nullptr : this->m_Name.c_str()); }
2023-02-28 11:35:54 +08:00
void SetName(CKSTRING u8_name) { this->m_Name = (u8_name == nullptr ? "" : u8_name); }
2023-02-26 21:48:03 +08:00
CK_OBJECT_FLAGS GetObjectFlags(void) { return this->m_ObjectFlags; }
void SetObjectFlags(CK_OBJECT_FLAGS flags) { this->m_ObjectFlags = flags; }
virtual CK_CLASSID GetClassID(void) { return CK_CLASSID::CKCID_OBJECT; }
2023-03-05 22:31:11 +08:00
virtual bool Load(CKStateChunk* chunk, const CKFileDocument* doc);
2023-03-03 11:06:26 +08:00
virtual CKStateChunk* Save(const CKFileDocument* doc);
2023-02-26 21:48:03 +08:00
};
class CKSceneObject : public CKObject {
public:
2023-02-27 22:23:05 +08:00
CKSceneObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKSceneObject(const CKSceneObject&) = delete;
CKSceneObject& operator=(const CKSceneObject&) = delete;
virtual ~CKSceneObject();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_SCENEOBJECT; }
protected:
XBitArray m_Scenes;
};
class CKBeObject : public CKSceneObject {
public:
2023-02-27 22:23:05 +08:00
CKBeObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKBeObject(const CKBeObject&) = delete;
CKBeObject& operator=(const CKBeObject&) = delete;
virtual ~CKBeObject();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_BEOBJECT; }
protected:
};
2023-03-08 21:36:13 +08:00
#pragma region Map Related
2023-02-26 21:48:03 +08:00
class CKGroup : public CKBeObject {
public:
2023-02-27 22:23:05 +08:00
CKGroup(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKGroup(const CKGroup&) = delete;
CKGroup& operator=(const CKGroup&) = delete;
virtual ~CKGroup();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_GROUP; }
protected:
};
class CKMesh : public CKBeObject {
public:
2023-02-27 22:23:05 +08:00
CKMesh(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKMesh(const CKMesh&) = delete;
CKMesh& operator=(const CKMesh&) = delete;
virtual ~CKMesh();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_MESH; }
protected:
};
class CKTexture : public CKBeObject {
public:
2023-02-27 22:23:05 +08:00
CKTexture(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKTexture(const CKTexture&) = delete;
CKTexture& operator=(const CKTexture&) = delete;
virtual ~CKTexture();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_TEXTURE; }
protected:
};
class CKMaterial : public CKBeObject {
public:
2023-02-27 22:23:05 +08:00
CKMaterial(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKMaterial(const CKMaterial&) = delete;
CKMaterial& operator=(const CKMaterial&) = delete;
virtual ~CKMaterial();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_MATERIAL; }
protected:
};
class CKRenderObject : public CKBeObject {
public:
2023-02-27 22:23:05 +08:00
CKRenderObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CKRenderObject(const CKRenderObject&) = delete;
CKRenderObject& operator=(const CKRenderObject&) = delete;
~CKRenderObject();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_RENDEROBJECT; }
protected:
};
2023-02-27 22:23:05 +08:00
class CK3dEntity : public CKRenderObject {
2023-02-26 21:48:03 +08:00
public:
2023-02-27 22:23:05 +08:00
CK3dEntity(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CK3dEntity(const CK3dEntity&) = delete;
CK3dEntity& operator=(const CK3dEntity&) = delete;
virtual ~CK3dEntity();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_3DENTITY; }
protected:
};
class CK3dObject :public CK3dEntity {
public:
2023-02-27 22:23:05 +08:00
CK3dObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
2023-02-26 21:48:03 +08:00
CK3dObject(const CK3dObject&) = delete;
CK3dObject& operator=(const CK3dObject&) = delete;
~CK3dObject();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_3DOBJECT; }
protected:
};
2023-03-08 21:36:13 +08:00
#pragma endregion
#pragma region Behavior Related
class CKParameterIn :public CKObject {
public:
CKParameterIn(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKParameterIn(const CKParameterIn&) = delete;
CKParameterIn& operator=(const CKParameterIn&) = delete;
~CKParameterIn();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_PARAMETERIN; }
protected:
};
class CKParameter :public CKObject {
public:
CKParameter(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKParameter(const CKParameter&) = delete;
CKParameter& operator=(const CKParameter&) = delete;
~CKParameter();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_PARAMETER; }
protected:
};
class CKParameterOut :public CKParameter {
public:
CKParameterOut(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKParameterOut(const CKParameterOut&) = delete;
CKParameterOut& operator=(const CKParameterOut&) = delete;
~CKParameterOut();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_PARAMETEROUT; }
protected:
};
class CKParameterLocal :public CKParameter {
public:
CKParameterLocal(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKParameterLocal(const CKParameterLocal&) = delete;
CKParameterLocal& operator=(const CKParameterLocal&) = delete;
~CKParameterLocal();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_PARAMETERLOCAL; }
protected:
};
class CKParameterOperation :public CKObject {
public:
CKParameterOperation(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKParameterOperation(const CKParameterOperation&) = delete;
CKParameterOperation& operator=(const CKParameterOperation&) = delete;
~CKParameterOperation();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_PARAMETEROPERATION; }
protected:
};
class CKBehaviorLink :public CKObject {
public:
CKBehaviorLink(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKBehaviorLink(const CKBehaviorLink&) = delete;
CKBehaviorLink& operator=(const CKBehaviorLink&) = delete;
~CKBehaviorLink();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_BEHAVIORLINK; }
protected:
};
class CKBehaviorIO :public CKObject {
public:
CKBehaviorIO(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKBehaviorIO(const CKBehaviorIO&) = delete;
CKBehaviorIO& operator=(const CKBehaviorIO&) = delete;
~CKBehaviorIO();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_BEHAVIORIO; }
protected:
};
class CKBehavior :public CKSceneObject {
public:
CKBehavior(CKMinContext* ctx, CK_ID ckid, CKSTRING name);
CKBehavior(const CKBehavior&) = delete;
CKBehavior& operator=(const CKBehavior&) = delete;
~CKBehavior();
virtual CK_CLASSID GetClassID(void) override { return CK_CLASSID::CKCID_BEHAVIOR; }
protected:
};
#pragma endregion
2023-02-26 21:48:03 +08:00
}