2023-08-31 21:54:25 +08:00
|
|
|
#include "CKSceneObject.hpp"
|
|
|
|
#include "../CKStateChunk.hpp"
|
2023-09-06 10:42:23 +08:00
|
|
|
#include "../CKContext.hpp"
|
|
|
|
#include "../MgrImpls/CKObjectManager.hpp"
|
2023-08-31 21:54:25 +08:00
|
|
|
#include "CKBeObject.hpp"
|
2023-09-01 13:27:46 +08:00
|
|
|
#include "CKGroup.hpp"
|
2023-08-31 21:54:25 +08:00
|
|
|
|
|
|
|
namespace LibCmo::CK2::ObjImpls {
|
|
|
|
|
2023-09-06 10:42:23 +08:00
|
|
|
CKBeObject::CKBeObject(CKContext* ctx, CK_ID ckid, CKSTRING name) :
|
2023-09-16 22:38:21 +08:00
|
|
|
CKSceneObject(ctx, ckid, name), m_Groups() {}
|
2023-09-06 10:42:23 +08:00
|
|
|
|
2023-09-20 15:25:43 +08:00
|
|
|
CKBeObject::~CKBeObject() {}
|
2023-09-06 10:42:23 +08:00
|
|
|
|
2023-08-31 21:54:25 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-09-22 16:40:10 +08:00
|
|
|
bool CKBeObject::IsInGroup(CKGroup* group) const {
|
2023-09-01 13:27:46 +08:00
|
|
|
if (group == nullptr) return false;
|
2023-09-16 22:38:21 +08:00
|
|
|
CKDWORD idx = group->GetGroupIndex();
|
2023-09-17 12:39:21 +08:00
|
|
|
return XContainer::NSXBitArray::IsSet(m_Groups, idx);
|
2023-08-31 21:54:25 +08:00
|
|
|
}
|
|
|
|
|
2023-09-16 22:38:21 +08:00
|
|
|
void CKBeObject::ExplicitSetGroup(CKDWORD pos, bool val) {
|
2023-09-17 12:39:21 +08:00
|
|
|
if (val) {
|
|
|
|
XContainer::NSXBitArray::Set(m_Groups, pos);
|
|
|
|
} else {
|
|
|
|
XContainer::NSXBitArray::Unset(m_Groups, pos);
|
|
|
|
}
|
2023-09-01 12:19:06 +08:00
|
|
|
}
|
|
|
|
|
2023-08-31 21:54:25 +08:00
|
|
|
}
|