Support for "name" attribute on entities

This commit is contained in:
2016-01-11 11:24:00 +01:00
parent c47ef61ddc
commit 297a3fb493
7 changed files with 69 additions and 25 deletions
+5
View File
@@ -37,6 +37,10 @@ public:
const std::unordered_map<std::string, ComponentPool*>& GetComponentPools() const { return m_ComponentPools; }
// Get the entity children map
const std::unordered_multimap<EntityID, EntityID>& GetEntityChildren() const { return m_EntityChildren; }
// Set the textual name of an entity
void SetName(EntityID entity, const std::string& name);
// Get the textual name of an entity
std::string GetName(EntityID entity) const;
private:
EntityID m_CurrentEntityID = 0;
@@ -45,6 +49,7 @@ private:
// TODO: This should be a more effective structure
std::unordered_multimap<EntityID, EntityID> m_EntityChildren;
std::unordered_map<std::string, ComponentPool*> m_ComponentPools;
std::unordered_map<EntityID, std::string> m_EntityNames;
EntityID generateEntityID();
};