2023-08-31 21:54:25 +08:00
|
|
|
#pragma once
|
|
|
|
|
2024-08-17 20:43:27 +08:00
|
|
|
#include "../../VTInternal.hpp"
|
2023-08-31 21:54:25 +08:00
|
|
|
#include "CKBeObject.hpp"
|
|
|
|
|
|
|
|
namespace LibCmo::CK2::ObjImpls {
|
|
|
|
|
|
|
|
class CKGroup : public CKBeObject {
|
|
|
|
public:
|
2023-09-01 12:19:06 +08:00
|
|
|
CKGroup(CKContext* ctx, CK_ID ckid, CKSTRING name);
|
|
|
|
virtual ~CKGroup();
|
2024-08-17 20:43:27 +08:00
|
|
|
YYCC_DEL_CLS_COPY_MOVE(CKGroup);
|
2023-08-31 21:54:25 +08:00
|
|
|
|
|
|
|
virtual CK_CLASSID GetClassID(void) override {
|
|
|
|
return CK_CLASSID::CKCID_GROUP;
|
|
|
|
}
|
2023-09-20 15:25:43 +08:00
|
|
|
|
|
|
|
virtual void PreDelete() override;
|
|
|
|
virtual void CheckPreDeletion() override;
|
|
|
|
|
2023-08-31 21:54:25 +08:00
|
|
|
//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;
|
|
|
|
|
2023-09-20 13:13:08 +08:00
|
|
|
// it only have special Show method
|
|
|
|
virtual void Show(CK_OBJECT_SHOWOPTION show = CK_OBJECT_SHOWOPTION::CKSHOW) override;
|
|
|
|
|
2023-09-22 16:40:10 +08:00
|
|
|
CKDWORD GetGroupIndex() const;
|
2023-08-31 21:54:25 +08:00
|
|
|
|
|
|
|
// ===== Insert =====
|
|
|
|
CKERROR AddObject(CKBeObject *o);
|
|
|
|
|
|
|
|
// ===== Remove =====
|
|
|
|
CKBeObject* RemoveObject(CKDWORD pos);
|
|
|
|
void RemoveObject(CKBeObject *obj);
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
// ===== Access =====
|
2023-09-22 16:40:10 +08:00
|
|
|
CKBeObject* GetObject(CKDWORD pos) const;
|
|
|
|
CKDWORD GetObjectCount() const;
|
2023-08-31 21:54:25 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
XContainer::XObjectPointerArray m_ObjectArray;
|
|
|
|
CKDWORD m_GroupIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|