22 system.back()->InitializeEntity();
31 if (system[i]->
GetID() == Id)
35 return eastl::weak_ptr<Entity>();
38 void EntitySystem::Update()
42 if (system[i]->GetIsActive())
49 if (entityToAdd->GetID() == -1)
50 entityToAdd->SetID(entityCount);
52 system.push_back(eastl::move(entityToAdd));
58 if (system.size() == 0)
return;
60 eastl::shared_ptr<Entity>* it = eastl::find(system.begin(), system.end(), entityToRemove);
61 if (it != system.end())
67 system.shrink_to_fit();
void AddEntity(eastl::shared_ptr< Entity > entityToAdd)
This method allows you to add a precreated entity to the entity system The entity you want to add to ...
eastl::weak_ptr< Entity > GetEntity(uint64_t Id)
Allows you to get the entity you want based on the id number. NOTE: if you know the team id of the en...
This object is able a holder object for components. NOTE: only the EntitySystem is allowed to create ...
void RemoveAllEntities()
This method allows you to clear the entire entity system and all the teams.
void RemoveEntity(eastl::shared_ptr< Entity > entityToRemove)
This method allows you to remove a specific entity from the entity system The entity you want to remo...
eastl::vector< eastl::shared_ptr< Entity > > GetAllEntities() const
This method will allow you to get all entities availible.
eastl::weak_ptr< Entity > CreateEntity(eastl::string entityName="", int teamId=0)
Allows you to create a new Entity. This method will also add the entity to the given team if that tea...
IMGUI_API ImGuiID GetID(const char *str_id)