Cleaning up shutdown
This commit is contained in:
@@ -6,7 +6,14 @@ void HydraSystem::Update(float delta_t_seconds)
|
||||
UpdateSystem(delta_t_seconds);
|
||||
|
||||
}
|
||||
|
||||
void HydraSystem::Shutdown()
|
||||
{
|
||||
for(HydraID entity_id : Entities)
|
||||
{
|
||||
DestroyComponents(entity_id);
|
||||
}
|
||||
FreeSystemResources();
|
||||
}
|
||||
void HydraSystem::InitialiseComponents()
|
||||
{
|
||||
for(auto it = EntitiesToCreate.begin(); it != EntitiesToCreate.end(); ++it)
|
||||
@@ -16,3 +23,13 @@ void HydraSystem::InitialiseComponents()
|
||||
}
|
||||
EntitiesToCreate.clear();
|
||||
}
|
||||
|
||||
void HydraSystem::DestroyComponents(HydraID actor_id)
|
||||
{
|
||||
auto it = std::find(Entities.begin(), Entities.end(), actor_id);
|
||||
if(it == Entities.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
DestroyComponent(actor_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user