aboutsummaryrefslogtreecommitdiff
path: root/src/crepe
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-11-05 12:02:04 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-11-05 12:02:04 +0100
commit9adde5495c0c30d214c30e593cc289470448494c (patch)
treebfc2be1881ab9eddfc7c25d0930dfe1daaa7c182 /src/crepe
parent8eac9296a487f5b77fc1cba269c70ee23f7603dc (diff)
Added Matadata component
Diffstat (limited to 'src/crepe')
-rw-r--r--src/crepe/CMakeLists.txt3
-rw-r--r--src/crepe/Metadata.cpp10
-rw-r--r--src/crepe/Metadata.h22
3 files changed, 34 insertions, 1 deletions
diff --git a/src/crepe/CMakeLists.txt b/src/crepe/CMakeLists.txt
index d938eb8..9ad1ff9 100644
--- a/src/crepe/CMakeLists.txt
+++ b/src/crepe/CMakeLists.txt
@@ -12,8 +12,8 @@ target_sources(crepe PUBLIC
CollisionSystem.cpp
Collider.cpp
SDLContext.cpp
-
RenderSystem.cpp
+ Metadata.cpp
)
target_sources(crepe PUBLIC FILE_SET HEADERS FILES
@@ -31,6 +31,7 @@ target_sources(crepe PUBLIC FILE_SET HEADERS FILES
Collider.h
SDLContext.h
RenderSystem.h
+ Metadata.h
)
add_subdirectory(api)
diff --git a/src/crepe/Metadata.cpp b/src/crepe/Metadata.cpp
new file mode 100644
index 0000000..3d1d910
--- /dev/null
+++ b/src/crepe/Metadata.cpp
@@ -0,0 +1,10 @@
+#include "Metadata.h"
+
+using namespace crepe;
+using namespace std;
+
+Metadata::Metadata(uint32_t gameObjectId, string name, string tag) : Component(gameObjectId), name(name), tag(tag) {}
+
+int Metadata::get_instances_max() const {
+ return 1;
+}
diff --git a/src/crepe/Metadata.h b/src/crepe/Metadata.h
new file mode 100644
index 0000000..2f08476
--- /dev/null
+++ b/src/crepe/Metadata.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "Component.h"
+
+namespace crepe {
+
+class Metadata : public Component {
+public:
+ Metadata(uint32_t game_object_id, std::string name, std::string tag);
+ int get_instances_max() const;
+
+public:
+ std::string name;
+ std::string tag;
+ uint32_t parent = UINT32_MAX;
+ std::vector<uint32_t> children;
+};
+
+} // namespace crepe