prepare dev for CKGroup
This commit is contained in:
parent
4c741ae778
commit
3755a2e148
25
LibCmo/CK2/ObjImpls/CKBeObject.cpp
Normal file
25
LibCmo/CK2/ObjImpls/CKBeObject.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "CKSceneObject.hpp"
|
||||
#include "../CKStateChunk.hpp"
|
||||
#include "CKBeObject.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
bool CKBeObject::Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) {
|
||||
bool suc = CKSceneObject::Save(chunk, file, flags);
|
||||
if (!suc) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CKBeObject::Load(CKStateChunk* chunk, CKFileVisitor* file) {
|
||||
bool suc = CKSceneObject::Load(chunk, file);
|
||||
if (!suc) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CKBeObject::IsInGroup(CKGroup* group) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
30
LibCmo/CK2/ObjImpls/CKBeObject.hpp
Normal file
30
LibCmo/CK2/ObjImpls/CKBeObject.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include "../../VTAll.hpp"
|
||||
#include "CKSceneObject.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
class CKBeObject : public CKSceneObject {
|
||||
public:
|
||||
CKBeObject(CKContext* ctx, CK_ID ckid, CKSTRING name) :
|
||||
CKSceneObject(ctx, ckid, name)
|
||||
{}
|
||||
virtual ~CKBeObject() {}
|
||||
LIBCMO_DISABLE_COPY_MOVE(CKBeObject);
|
||||
|
||||
virtual CK_CLASSID GetClassID(void) override {
|
||||
return CK_CLASSID::CKCID_BEOBJECT;
|
||||
}
|
||||
//virtual void PreSave(CKFileVisitor* file, CKDWORD flags) override;
|
||||
virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) override;
|
||||
virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file) override;
|
||||
//virtual void PostLoad() override;
|
||||
|
||||
bool IsInGroup(CKGroup* group);
|
||||
|
||||
protected:
|
||||
XContainer::XBitArray m_Groups;
|
||||
};
|
||||
|
||||
}
|
27
LibCmo/CK2/ObjImpls/CKGroup.cpp
Normal file
27
LibCmo/CK2/ObjImpls/CKGroup.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "CKSceneObject.hpp"
|
||||
#include "../CKStateChunk.hpp"
|
||||
#include "CKGroup.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
bool CKGroup::Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CKGroup::Load(CKStateChunk* chunk, CKFileVisitor* file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CKDWORD CKGroup::GetGroupIndex() {
|
||||
return m_GroupIndex;
|
||||
}
|
||||
|
||||
CKObject* CKGroup::GetObject(CKDWORD pos) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CKDWORD CKGroup::GetObjectCount() {
|
||||
return CKDWORD();
|
||||
}
|
||||
|
||||
}
|
53
LibCmo/CK2/ObjImpls/CKGroup.hpp
Normal file
53
LibCmo/CK2/ObjImpls/CKGroup.hpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
#pragma once
|
||||
|
||||
#include "../../VTAll.hpp"
|
||||
#include "CKBeObject.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
class CKGroup : public CKBeObject {
|
||||
public:
|
||||
CKGroup(CKContext* ctx, CK_ID ckid, CKSTRING name) :
|
||||
CKBeObject(ctx, ckid, name),
|
||||
m_ObjectArray(),
|
||||
m_GroupIndex() // todo: allocate group id
|
||||
{}
|
||||
virtual ~CKGroup() {
|
||||
// todo: free allocated group id
|
||||
}
|
||||
LIBCMO_DISABLE_COPY_MOVE(CKGroup);
|
||||
|
||||
virtual CK_CLASSID GetClassID(void) override {
|
||||
return CK_CLASSID::CKCID_GROUP;
|
||||
}
|
||||
//virtual void PreSave(CKFileVisitor* file, CKDWORD flags) override;
|
||||
virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) override;
|
||||
virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file) override;
|
||||
//virtual void PostLoad() override;
|
||||
|
||||
CKDWORD GetGroupIndex();
|
||||
|
||||
// ===== Insert =====
|
||||
CKERROR AddObject(CKBeObject *o);
|
||||
CKERROR AddObjectFront(CKBeObject *o);
|
||||
CKERROR InsertObjectAt(CKBeObject *o, CKDWORD pos);
|
||||
|
||||
// ===== Remove =====
|
||||
CKBeObject* RemoveObject(CKDWORD pos);
|
||||
void RemoveObject(CKBeObject *obj);
|
||||
void Clear();
|
||||
|
||||
// ===== Order =====
|
||||
void MoveObjectUp(CKBeObject *o);
|
||||
void MoveObjectDown(CKBeObject *o);
|
||||
|
||||
// ===== Access =====
|
||||
CKObject* GetObject(CKDWORD pos);
|
||||
CKDWORD GetObjectCount();
|
||||
|
||||
protected:
|
||||
XContainer::XObjectPointerArray m_ObjectArray;
|
||||
CKDWORD m_GroupIndex;
|
||||
};
|
||||
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "../../VTUtils.hpp"
|
||||
#include "../CKContext.hpp"
|
||||
#include "../../VTAll.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
|
@ -38,13 +37,12 @@ namespace LibCmo::CK2::ObjImpls {
|
|||
virtual CK_CLASSID GetClassID(void) {
|
||||
return CK_CLASSID::CKCID_OBJECT;
|
||||
}
|
||||
|
||||
virtual void PreSave(CKFileVisitor* file, CKDWORD flags);
|
||||
virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags);
|
||||
virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file);
|
||||
virtual void PostLoad();
|
||||
|
||||
private:
|
||||
protected:
|
||||
CK_ID m_ID;
|
||||
TypeHelper::MKString m_Name;
|
||||
CK_OBJECT_FLAGS m_ObjectFlags;
|
||||
|
|
15
LibCmo/CK2/ObjImpls/CKSceneObject.cpp
Normal file
15
LibCmo/CK2/ObjImpls/CKSceneObject.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "CKSceneObject.hpp"
|
||||
#include "../CKStateChunk.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
//bool CKSceneObject::Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
//bool CKSceneObject::Load(CKStateChunk* chunk, CKFileVisitor* file) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
}
|
||||
|
29
LibCmo/CK2/ObjImpls/CKSceneObject.hpp
Normal file
29
LibCmo/CK2/ObjImpls/CKSceneObject.hpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "../../VTAll.hpp"
|
||||
#include "CKObject.hpp"
|
||||
|
||||
namespace LibCmo::CK2::ObjImpls {
|
||||
|
||||
class CKSceneObject : public CKObject {
|
||||
public:
|
||||
CKSceneObject(CKContext* ctx, CK_ID ckid, CKSTRING name) :
|
||||
CKObject(ctx, ckid, name),
|
||||
m_Scenes() {}
|
||||
virtual ~CKSceneObject() {}
|
||||
LIBCMO_DISABLE_COPY_MOVE(CKSceneObject);
|
||||
|
||||
virtual CK_CLASSID GetClassID(void) override {
|
||||
return CK_CLASSID::CKCID_SCENEOBJECT;
|
||||
}
|
||||
// CKSceneObject do not override any RW functions.
|
||||
//virtual void PreSave(CKFileVisitor* file, CKDWORD flags) override;
|
||||
//virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) override;
|
||||
//virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file) override;
|
||||
//virtual void PostLoad() override;
|
||||
|
||||
protected:
|
||||
XContainer::XBitArray m_Scenes;
|
||||
};
|
||||
|
||||
}
|
|
@ -180,7 +180,10 @@
|
|||
<ClCompile Include="CK2\CKGlobals.cpp" />
|
||||
<ClCompile Include="CK2\MgrImpls\CKBaseManager.cpp" />
|
||||
<ClCompile Include="CK2\CKContext.cpp" />
|
||||
<ClCompile Include="CK2\ObjImpls\CKBeObject.cpp" />
|
||||
<ClCompile Include="CK2\ObjImpls\CKGroup.cpp" />
|
||||
<ClCompile Include="CK2\ObjImpls\CKObject.cpp" />
|
||||
<ClCompile Include="CK2\ObjImpls\CKSceneObject.cpp" />
|
||||
<ClCompile Include="VTEncoding.cpp" />
|
||||
<ClCompile Include="CK2\CKFileReader.cpp" />
|
||||
<ClCompile Include="CK2\CKStateChunk.cpp" />
|
||||
|
@ -197,6 +200,9 @@
|
|||
<ClInclude Include="CK2\CKContext.hpp" />
|
||||
<ClInclude Include="CK2\CKStateChunk.hpp" />
|
||||
<ClInclude Include="CK2\CKTypes.hpp" />
|
||||
<ClInclude Include="CK2\ObjImpls\CKBeObject.hpp" />
|
||||
<ClInclude Include="CK2\ObjImpls\CKGroup.hpp" />
|
||||
<ClInclude Include="CK2\ObjImpls\CKSceneObject.hpp" />
|
||||
<ClInclude Include="VTAll.hpp" />
|
||||
<ClInclude Include="VTEncoding.hpp" />
|
||||
<ClInclude Include="CK2\ObjImpls\CKObject.hpp" />
|
||||
|
|
|
@ -78,6 +78,15 @@
|
|||
<ClCompile Include="CK2\CKStateChunk.cpp">
|
||||
<Filter>Sources\CK2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CK2\ObjImpls\CKSceneObject.cpp">
|
||||
<Filter>Sources\CK2\ObjImpls</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CK2\ObjImpls\CKBeObject.cpp">
|
||||
<Filter>Sources\CK2\ObjImpls</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CK2\ObjImpls\CKGroup.cpp">
|
||||
<Filter>Sources\CK2\ObjImpls</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="VTUtils.hpp">
|
||||
|
@ -122,11 +131,20 @@
|
|||
<ClInclude Include="VTAll.hpp">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CK2\MgrImpls\CKBaseManager.hpp">
|
||||
<ClInclude Include="CK2\ObjImpls\CKObject.hpp">
|
||||
<Filter>Headers\CK2\ObjImpls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CK2\ObjImpls\CKObject.hpp">
|
||||
<ClInclude Include="CK2\MgrImpls\CKBaseManager.hpp">
|
||||
<Filter>Headers\CK2\MgrImpls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CK2\ObjImpls\CKBeObject.hpp">
|
||||
<Filter>Headers\CK2\ObjImpls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CK2\ObjImpls\CKSceneObject.hpp">
|
||||
<Filter>Headers\CK2\ObjImpls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CK2\ObjImpls\CKGroup.hpp">
|
||||
<Filter>Headers\CK2\ObjImpls</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -7,6 +7,10 @@
|
|||
#if defined(LIBCMO_OS_WIN32)
|
||||
#include <Windows.h>
|
||||
#include <fileapi.h>
|
||||
// disable annoy macro at the same time
|
||||
#undef GetObject
|
||||
#undef GetClassName
|
||||
#undef LoadImage
|
||||
#else
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#if defined(_WIN32)
|
||||
#define LIBCMO_OS_WIN32
|
||||
// disable annoy win32 macro
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user