diff options
author | rtk0c <[email protected]> | 2022-04-08 22:30:12 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-04-08 22:30:12 -0700 |
commit | e7ef3f208c109357538b1f68af10bcd78db95c95 (patch) | |
tree | 066d614ae0f079e53602d7c0fd972998c546c8c1 /source/GameObject.cpp | |
parent | f163e8f37123e651ea80b690793845b31ddb8639 (diff) |
Changeset: 3 More work
Diffstat (limited to 'source/GameObject.cpp')
-rw-r--r-- | source/GameObject.cpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/source/GameObject.cpp b/source/GameObject.cpp index bbddb20..9f8a8bf 100644 --- a/source/GameObject.cpp +++ b/source/GameObject.cpp @@ -1,7 +1,38 @@ #include "GameObject.hpp" +#include "GameObjectTypeTag.hpp" #include "World.hpp" +#include <string_view> +#include <utility> + +namespace ProjectBrussel_UNITY_ID { +const char* kNamesGOMM[] = { + "None" /* GOMM_None */, + "AllChildren" /* GOMM_AllChildren */, + "SelfAndAllChildren" /* GOMM_SelfAndAllChildren */, + +}; +const char* kNamesGOT[] = { + "GameObject" /* GOT_Generic */, + "Player" /* GOT_Player */, + "Building" /* GOT_Building */, + "LevelWrapper" /* GOT_LevelWrapper */, +}; + +bool ValidateGameObjectChild(GameObject* parent, GameObject* child) { + return parent->GetWorld() == child->GetWorld(); +} +} // namespace ProjectBrussel_UNITY_ID + +const char* Tags::NameOf(GameObjectMemoryManagement value) { + return ProjectBrussel_UNITY_ID::kNamesGOMM[value]; +} + +const char* Tags::NameOf(GameObjectType value) { + return ProjectBrussel_UNITY_ID::kNamesGOT[value]; +} + void GameObject::FreeRecursive(GameObject* obj) { auto gomm = obj->GetMemoryManagement(); bool freeSelf = gomm != Tags::GOMM_SelfAndAllChildren; @@ -41,12 +72,6 @@ const PodVector<GameObject*>& GameObject::GetChildren() const { return mChildren; } -namespace ProjectBrussel_UNITY_ID { -bool ValidateGameObjectChild(GameObject* parent, GameObject* child) { - return parent->GetWorld() == child->GetWorld(); -} -} // namespace ProjectBrussel_UNITY_ID - void GameObject::AddChild(GameObject* child) { if (child->mParent) { return; @@ -115,7 +140,7 @@ const Material* GameObject::GetMeshMaterial() const { return nullptr; } -const Mesh* GameObject::GetMesh() const { +const GpuMesh* GameObject::GetMesh() const { return nullptr; } |