36 lines
733 B
C++
36 lines
733 B
C++
#include "HydraSystem.h"
|
|
|
|
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)
|
|
{
|
|
HydraID actor_id = *it;
|
|
InitialiseComponent(actor_id);
|
|
}
|
|
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);
|
|
}
|