mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 03:09:18 +02:00
ECS System WIP
This commit is contained in:
33
entitysystem/systems/SystemManager.cpp
Normal file
33
entitysystem/systems/SystemManager.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by Daniu
|
||||
//
|
||||
|
||||
#include "SystemManager.h"
|
||||
#include "entitysystem/systems/BaseSystem.h"
|
||||
#include "entitysystem/ECWorld.h"
|
||||
#include "utilities/Logs.h"
|
||||
|
||||
SystemManager::~SystemManager() = default;
|
||||
|
||||
void SystemManager::Create(ECWorld& world)
|
||||
{
|
||||
WriteLog("[SystemManager] Creating systems");
|
||||
for (auto& system : m_systems){
|
||||
system->OnCreate(world);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SystemManager::Destroy(ECWorld& world)
|
||||
{
|
||||
WriteLog("[SystemManager] Destroying systems");
|
||||
for (auto& system : m_systems)
|
||||
system->OnDestroy(world);
|
||||
}
|
||||
|
||||
void SystemManager::Update(ECWorld& world, float dt)
|
||||
{
|
||||
|
||||
for (auto& system : m_systems)
|
||||
system->Update(world, dt);
|
||||
}
|
||||
Reference in New Issue
Block a user