2023-02-26 21:48:03 +08:00
|
|
|
#include "../CKObjects.hpp"
|
2023-02-28 14:04:38 +08:00
|
|
|
#include "../CKStateChunk.hpp"
|
|
|
|
#include "../CKIdentifiers.hpp"
|
|
|
|
#include "../VTUtils.hpp"
|
2023-02-26 21:48:03 +08:00
|
|
|
|
|
|
|
namespace LibCmo::CK2::CKObjectImplements {
|
|
|
|
|
2023-02-27 22:23:05 +08:00
|
|
|
CKObject::CKObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) :
|
|
|
|
m_ID(ckid), m_Context(ctx),
|
2023-02-28 11:35:54 +08:00
|
|
|
m_Name(name == nullptr ? "" : name),
|
2023-02-27 22:23:05 +08:00
|
|
|
m_ObjectFlags(CK_OBJECT_FLAGS::CK_PARAMETERIN_DISABLED) {
|
|
|
|
;
|
2023-02-26 21:48:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CKObject::~CKObject() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-03-05 22:31:11 +08:00
|
|
|
bool CKObject::Load(CKStateChunk* chunk, const CKFileDocument* doc) {
|
2023-02-28 14:04:38 +08:00
|
|
|
if (chunk->SeekIdentifier(Identifiers::CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIDDEN)) {
|
|
|
|
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
|
|
|
|
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE,
|
|
|
|
CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE }
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
if (chunk->SeekIdentifier(Identifiers::CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIERAHIDDEN)) {
|
|
|
|
// != 0
|
|
|
|
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
|
|
|
|
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE, }
|
|
|
|
);
|
|
|
|
EnumsHelper::FlagEnumAdd(this->m_ObjectFlags,
|
|
|
|
{ CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE, }
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// == 0
|
|
|
|
EnumsHelper::FlagEnumAdd(this->m_ObjectFlags,
|
|
|
|
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE, }
|
|
|
|
);
|
|
|
|
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
|
|
|
|
{ CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE, }
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-05 22:31:11 +08:00
|
|
|
return true;
|
2023-02-28 11:35:54 +08:00
|
|
|
}
|
2023-03-03 11:06:26 +08:00
|
|
|
CKStateChunk* CKObject::Save(const CKFileDocument* doc) {
|
2023-02-28 11:35:54 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-02-27 22:23:05 +08:00
|
|
|
CKSceneObject::CKSceneObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKSceneObject::~CKSceneObject() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKBeObject::CKBeObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKSceneObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKBeObject::~CKBeObject() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKGroup::CKGroup(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKGroup::~CKGroup() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKMesh::CKMesh(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKMesh::~CKMesh() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKTexture::CKTexture(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
|
|
|
|
}
|
2023-02-28 11:35:54 +08:00
|
|
|
CKTexture::~CKTexture() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKMaterial::CKMaterial(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
|
|
|
|
}
|
2023-02-27 22:23:05 +08:00
|
|
|
CKMaterial::~CKMaterial() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKRenderObject::CKRenderObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKRenderObject::~CKRenderObject() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CK3dEntity::CK3dEntity(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKRenderObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CK3dEntity::~CK3dEntity() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CK3dObject::CK3dObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CK3dEntity(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CK3dObject::~CK3dObject() {
|
|
|
|
}
|
|
|
|
|
2023-03-08 21:36:13 +08:00
|
|
|
|
|
|
|
CKParameterIn::CKParameterIn(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKParameterIn::~CKParameterIn() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKParameter::CKParameter(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKParameter::~CKParameter() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKParameterOut::CKParameterOut(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKParameter(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKParameterOut::~CKParameterOut() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKParameterLocal::CKParameterLocal(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKParameter(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKParameterLocal::~CKParameterLocal() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKParameterOperation::CKParameterOperation(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKParameterOperation::~CKParameterOperation() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKBehaviorLink::CKBehaviorLink(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKBehaviorLink::~CKBehaviorLink() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKBehaviorIO::CKBehaviorIO(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKBehaviorIO::~CKBehaviorIO() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CKBehavior::CKBehavior(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKSceneObject(ctx, ckid, name) {
|
|
|
|
}
|
|
|
|
CKBehavior::~CKBehavior() {
|
|
|
|
}
|
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
}
|