Added World DeleteEntity, HasComponent and GetEntityChildren

This commit is contained in:
2015-12-13 23:40:45 +01:00
parent b8620eac26
commit 07c4744436
2 changed files with 47 additions and 3 deletions
+6
View File
@@ -14,11 +14,15 @@ public:
// Create empty entity
EntityID CreateEntity(EntityID parent = 0);
// Delete entity and all components within
void DeleteEntity(EntityID entity);
// Register a component type and allocate space for it
void RegisterComponent(ComponentInfo& ci);
// Attach a component to an entity and fill it with default values
ComponentWrapper AttachComponent(EntityID entity, std::string componentType);
// Check if an entity has a component
bool HasComponent(EntityID entity, std::string componentType);
// Get a component of an entity
ComponentWrapper GetComponent(EntityID entity, std::string componentType);
// Delete a component off an entity
@@ -29,6 +33,8 @@ public:
EntityID GetParent(EntityID entity);
// Get all component pools
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; }
private:
EntityID m_CurrentEntityID = 1;