Files
HydraV3/HydraEngine/source/ecs/HydraSystem.cpp
T

44 lines
947 B
C++
Raw Normal View History

2026-07-17 15:30:29 +01:00
#include "HydraSystem.h"
void HydraSystem::Update(float delta_t_seconds)
{
UpdateSystem(delta_t_seconds);
}
2026-08-28 16:36:25 +01:00
2026-08-17 21:44:00 +01:00
void HydraSystem::Shutdown()
{
for(HydraID entity_id : Entities)
{
2026-08-28 16:36:25 +01:00
DestroyComponent(entity_id);
2026-08-17 21:44:00 +01:00
}
FreeSystemResources();
}
2026-07-17 15:30:29 +01:00
void HydraSystem::InitialiseComponents()
{
for(auto it = EntitiesToCreate.begin(); it != EntitiesToCreate.end(); ++it)
{
HydraID actor_id = *it;
InitialiseComponent(actor_id);
}
EntitiesToCreate.clear();
}
2026-08-28 16:36:25 +01:00
void HydraSystem::DeleteComponents()
2026-08-17 21:44:00 +01:00
{
2026-08-28 16:36:25 +01:00
for(auto it = EntitiesToDelete.begin(); it != EntitiesToDelete.end(); ++it)
2026-08-17 21:44:00 +01:00
{
2026-08-28 16:36:25 +01:00
HydraID actor_id = *it;
DestroyComponent(actor_id);
}
EntitiesToDelete.clear();
}
void HydraSystem::DeleteComponent(HydraID actor_id)
{
if(std::find(Entities.begin(), Entities.end(), actor_id)!= Entities.end())
{
DestroyComponent(actor_id);
2026-08-17 21:44:00 +01:00
}
}