Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
SystemManager.hpp
Go to the documentation of this file.
1#pragma once
2#include "System.hpp"
3#include <memory>
4#include <vector>
5#include <iostream>
6#include <typeinfo>
7
8
14public:
19 void addSystem(std::shared_ptr<System> system) {
20 systems.push_back(system);
21 }
22
27 void updateAll(float dt) {
28 for (auto& system : systems) {
29 system->update(dt);
30 }
31 }
32
33
34
40 void clear() {
41 systems.clear();
42 }
43
44private:
46 std::vector<std::shared_ptr<System>> systems;
47};
Manages registration and sequential updating of active ECS systems.
Definition SystemManager.hpp:13
std::vector< std::shared_ptr< System > > systems
Collection of registered systems.
Definition SystemManager.hpp:46
void updateAll(float dt)
Triggers the update routine on all registered systems.
Definition SystemManager.hpp:27
void addSystem(std::shared_ptr< System > system)
Registers a new system with the manager.
Definition SystemManager.hpp:19
void clear()
Removes and releases all registered systems. Call this before destroying Vulkan resources to ensure s...
Definition SystemManager.hpp:40