]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Entity.hpp
give unique IDs to entities
[blank.git] / src / world / Entity.hpp
index a3811427332628250761bad32210bc64103ea9de..c0d9a0bd858159bbd969f225d15abf16f689fa92 100644 (file)
@@ -5,6 +5,7 @@
 #include "../model/CompositeInstance.hpp"
 #include "../model/geometry.hpp"
 
+#include <cstdint>
 #include <string>
 #include <glm/glm.hpp>
 #include <glm/gtc/quaternion.hpp>
@@ -23,6 +24,9 @@ public:
        CompositeInstance &GetModel() noexcept { return model; }
        const CompositeInstance &GetModel() const noexcept { return model; }
 
+       std::uint32_t ID() const noexcept { return id; }
+       void ID(std::uint32_t i) noexcept { id = i; }
+
        const std::string &Name() const noexcept { return name; }
        void Name(const std::string &n) { name = n; }
 
@@ -77,6 +81,7 @@ public:
 private:
        CompositeInstance model;
 
+       std::uint32_t id;
        std::string name;
 
        AABB bounds;