aboutsummaryrefslogtreecommitdiff
path: root/source/GameObject.cpp
diff options
context:
space:
mode:
authorhnOsmium0001 <[email protected]>2022-04-08 22:30:12 -0700
committerhnOsmium0001 <[email protected]>2022-04-08 22:30:12 -0700
commite47a98793e58a5dbbe76bfed27e59408e43538e4 (patch)
tree250eb4c4200efb63c493ac6f4adb83c89be10ea1 /source/GameObject.cpp
parent3fdc6eb4f2cbeffce9b250beec4d3a2d52a3f534 (diff)
More work
Diffstat (limited to 'source/GameObject.cpp')
-rw-r--r--source/GameObject.cpp39
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;
}