|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Container for organizing and executing systems. More...
#include <System.hpp>
Public Member Functions | |
| void | addSystem (Unique< System > system) |
| Adds an existing system to the group. | |
| template<typename T, typename... Args> | |
| T & | createSystem (Args &&... args) |
| Creates and adds a system to the group. | |
| void | init (Registry ®istry) |
| Initializes all systems in the group. | |
| void | update (World &world) |
| Updates all enabled systems. | |
| void | shutdown (Registry ®istry) |
| Shuts down all systems. | |
Container for organizing and executing systems.
Manages a collection of systems, executing them in priority order during update. Systems with lower priority values execute first.
Definition at line 163 of file System.hpp.
Adds an existing system to the group.
| system | Unique pointer to the system (ownership transferred) |
The group takes ownership of the system. Systems are automatically sorted by priority after adding.
Definition at line 172 of file System.hpp.
Referenced by createSystem().
|
inline |
Creates and adds a system to the group.
| T | The system type to create |
| Args | Constructor argument types |
| args | Arguments forwarded to T's constructor |
Definition at line 190 of file System.hpp.
References addSystem(), and esengine::makeUnique().
|
inline |
Initializes all systems in the group.
| registry | Reference to the ECS registry |
Calls init() on each system in priority order. Should be called once before the main loop.
Definition at line 204 of file System.hpp.
|
inline |
Shuts down all systems.
| registry | Reference to the ECS registry |
Calls shutdown() on each system in priority order. Should be called once after the main loop.
Definition at line 233 of file System.hpp.
|
inline |
Updates all enabled systems.
| registry | Reference to the ECS registry |
| deltaTime | Time since last frame in seconds |
Calls update() on each enabled system in priority order. Disabled systems are skipped.
Definition at line 218 of file System.hpp.