7#include <unordered_map>
8#include "../Datastructures/eventmap.h"
9#include "../Entity/entity.h"
41 enum Id : uint64_t {};
55 template <
typename ...DataType>
78 template <
typename Event,
typename ...DataType>
88 template <
typename Event>
102 template <
typename Event,
typename ...DataType>
113 template <
typename Event>
195 static uint64_t the_id;
A mapping between events (which are ints under the hood) and callbacks.
Definition: eventmap.h:45
Id
Definition: eventmap.h:47
Manages Systems in the ECS model. Allows for System to be added, but not invoked.
Definition: systemManager.h:17
void removeStagedSystem(EventMap::Id id, Stage stage=Stage::Update)
Remove a staged System.
Definition: systemManager.cpp:8
Id
Used for id of Systems.
Definition: systemManager.h:41
void removeWindowResizeSystem(EventMap::Id id)
Remove a resize System.
Definition: systemManager.cpp:33
virtual ~SystemManager()
Definition: systemManager.cpp:6
EventMap mouseInputMap
Definition: systemManager.h:211
static auto id_value() -> uint64_t &
Definition: systemManager.h:193
EventMap::Id addStagedSystem(std::shared_ptr< System< DataType... > > system, Stage stage=Stage::Update)
Add a staged System to the list of systems.
Definition: systemManager.inl:8
SystemManager()
Definition: systemManager.cpp:5
std::unordered_map< int, EventMap > eventSystemsMap
Maps entity to an EventMap that maps Event to System.
Definition: systemManager.h:207
EventMap::Id addWindowResizeSystem(System< int, int > system)
Add a System to receive when the window resize.
Definition: systemManager.cpp:31
EventMap stagedSystemsMap
Map between Stage and Systems.
Definition: systemManager.h:202
EventMap::Id addEventSystem(Event event, std::shared_ptr< System< DataType... > > system)
Add an event System. Event systems are Systems triggerable by events broadcasted by the program,...
Definition: systemManager.inl:12
EventMap keyboardInputMap
Definition: systemManager.h:210
EventMap::Id addMousePosSystem(System< double, double > system)
Add a System to receive mouse position.
Definition: systemManager.cpp:21
void removeMouseEventSystem(int key, EventMap::Id id)
Remove a System from responding to mouse button inputs.
Definition: systemManager.cpp:18
void removeEventSystem(Event event, EventMap::Id id)
Remove the System from being called when an event is broadcasted.
Definition: systemManager.inl:17
EventMap::Id addMouseEventSystem(int key, System< int > system)
Add a System to respond to a mouse button inputs.
Definition: systemManager.cpp:16
EventMap::Id addKeyboardEventSystem(int key, System< int > system)
Add a System to respond to a keyboard input.
Definition: systemManager.cpp:11
EventMap otherInputMap
Definition: systemManager.h:212
Stage
Stages in the Saga engine where systems can be set to run in. Awake is a stage that happens at the ve...
Definition: systemManager.h:26
void removeMousePosSystem(EventMap::Id id)
Definition: systemManager.cpp:23
void removeKeyboardEventSystem(int key, EventMap::Id id)
Remove a keyboard System.
Definition: systemManager.cpp:13
void removeScrollSystem(EventMap::Id id)
Definition: systemManager.cpp:28
EventMap::Id addScrollSystem(System< double > system)
Add a System to receive scroll input.
Definition: systemManager.cpp:26
OtherInput
Types of input events, with button events excluded.
Definition: systemManager.h:188
std::function< void(std::shared_ptr< GameWorld >, DataType...)> System
System is a function that accepts a shared_ptr to a GameWorld, as well as extra variables.
Definition: system.h:14