23#include "guillaume/ecs/system_registry.hpp"
32 const auto index =
static_cast<std::size_t
>(system->getPhase());
33 if (index >= _systems.size()) {
34 throw std::out_of_range(
35 "SystemRegistry::registerNewSystem: invalid phase");
37 _systems[index].push_back(std::move(system));
40 const std::vector<std::unique_ptr<System>> &
43 const auto index =
static_cast<std::size_t
>(phase);
44 if (index >= _systems.size()) {
45 throw std::out_of_range(
46 "SystemRegistry::getSystemsByPhase: invalid phase");
48 return _systems[index];
const std::vector< std::unique_ptr< System > > & getSystemsByPhase(Phase phase) const
Get the systems of a phase, in the order they run.
void registerNewSystem(std::unique_ptr< System > system)
Take ownership of a system and append it to the list of its phase (System::getPhase).
The entity-component-system core, independent of any widget.
Phase
The four steps of a frame. Every system belongs to one of them.