aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Metadata.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 20:08:09 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 20:08:09 +0100
commit1c4156ee127b14760ed3b1a0cd16ad12180c7ac6 (patch)
tree211505d5328f24c9f9beabf8f874d9e13ef92130 /src/crepe/api/Metadata.h
parent9df087ede0b539ecbd2778236c7d1143362b384d (diff)
parent3d2428af8e8d9d49b4ade52d4806a7dae4cf1ab8 (diff)
merge `master` into `loek/savemgr`
Diffstat (limited to 'src/crepe/api/Metadata.h')
-rw-r--r--src/crepe/api/Metadata.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/crepe/api/Metadata.h b/src/crepe/api/Metadata.h
new file mode 100644
index 0000000..c61e006
--- /dev/null
+++ b/src/crepe/api/Metadata.h
@@ -0,0 +1,43 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "../Component.h"
+
+namespace crepe {
+
+/**
+ * \brief Metadata component
+ *
+ * This class represents the Metadata component. It stores the name, tag, parent
+ * and children of a GameObject.
+ */
+class Metadata : public Component {
+public:
+ /**
+ * \param game_object_id The id of the GameObject this component belongs to
+ * \param name The name of the GameObject
+ * \param tag The tag of the GameObject
+ */
+ Metadata(game_object_id_t id, const std::string & name,
+ const std::string & tag);
+ /**
+ * \brief Get the maximum number of instances for this component
+ *
+ * \return The maximum number of instances for this component
+ */
+ virtual int get_instances_max() const { return 1; }
+
+public:
+ //! The name of the GameObject
+ const std::string name;
+ //! The tag of the GameObject
+ const std::string tag;
+ //! The id of the parent GameObject (-1 if no parent)
+ game_object_id_t parent = -1;
+ //! The ids of the children GameObjects
+ std::vector<game_object_id_t> children;
+};
+
+} // namespace crepe