|
void | runStageStartup (std::shared_ptr< GameWorld > gameWorld) |
| Invoke the startup stage. This calls all systems attached in the Awake and Start stages.
|
|
void | runStageUpdate (std::shared_ptr< GameWorld > gameWorld, float deltaTime, float time) |
| Invoke the update stage. This calls any PreUpdate, Update, and LateUpdate systems in that order.
|
|
void | runStageFixedUpdate (std::shared_ptr< GameWorld > gameWorld, float deltaTime, float time) |
| Invoke the fixed update stage. This calls any FixUpdate, and LateFixedUpdate systems in that order.
|
|
void | runStageDraw (std::shared_ptr< GameWorld > gameWorld) |
| Invoke the Draw stage.
|
|
void | runStageCleanup (std::shared_ptr< GameWorld > gameWorld) |
| Invoke the Cleanup stage.
|
|
template<typename Event , typename ... DataType> |
void | broadcastEvent (Event event, std::shared_ptr< GameWorld > gameWorld, DataType... args) |
| Broadcast an event. Only systems registered that are not tied to a specific entity will receive this broadcast.
|
|
template<typename Event , typename ... DataType> |
void | deliverEvent (Event event, Entity entity, std::shared_ptr< GameWorld > gameWorld, DataType... args) |
| Deliver an event to an entity. Any system attached to that entity with this event will receive this delivery.
|
|
void | keyEvent (std::shared_ptr< GameWorld > gameWorld, int key, int action) |
| Broadcast a key event.
|
|
void | mousePosEvent (std::shared_ptr< GameWorld > gameWorld, double xpos, double ypos) |
| Broadcast a mouse position event.
|
|
void | mouseButtonEvent (std::shared_ptr< GameWorld > gameWorld, int button, int action) |
| Broadcast a mouse button event.
|
|
void | scrollEvent (std::shared_ptr< GameWorld > gameWorld, double distance) |
| Broadcast a scroll event.
|
|
void | windowResizeEvent (std::shared_ptr< GameWorld > gameWorld, int width, int height) |
| Broadcast a window resize event.
|
|
| SystemManager () |
|
virtual | ~SystemManager () |
|
template<typename ... DataType> |
EventMap::Id | addStagedSystem (std::shared_ptr< System< DataType... > > system, Stage stage=Stage::Update) |
| Add a staged System to the list of systems.
|
|
void | removeStagedSystem (EventMap::Id id, Stage stage=Stage::Update) |
| Remove a staged System.
|
|
template<typename Event , typename ... DataType> |
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, and not neccessarily the stages in normal execution. These Systems only respond to when events are being broadcasted.
|
|
template<typename Event > |
void | removeEventSystem (Event event, EventMap::Id id) |
| Remove the System from being called when an event is broadcasted.
|
|
template<typename Event , typename ... DataType> |
EventMap::Id | addEventSystem (Event event, Saga::Entity entity, std::shared_ptr< System< Saga::Entity, DataType... > > system) |
| Add an event System specific to an entity. This event System will be triggered when that event is delivered to the entity.
|
|
template<typename Event > |
void | removeEventSystem (Event event, Saga::Entity entity, EventMap::Id id) |
| Remove the System from being called when an event is delivered.
|
|
EventMap::Id | addKeyboardEventSystem (int key, System< int > system) |
| Add a System to respond to a keyboard input.
|
|
void | removeKeyboardEventSystem (int key, EventMap::Id id) |
| Remove a keyboard System.
|
|
EventMap::Id | addMouseEventSystem (int key, System< int > system) |
| Add a System to respond to a mouse button inputs.
|
|
void | removeMouseEventSystem (int key, EventMap::Id id) |
| Remove a System from responding to mouse button inputs.
|
|
EventMap::Id | addMousePosSystem (System< double, double > system) |
| Add a System to receive mouse position.
|
|
void | removeMousePosSystem (EventMap::Id id) |
|
EventMap::Id | addScrollSystem (System< double > system) |
| Add a System to receive scroll input.
|
|
void | removeScrollSystem (EventMap::Id id) |
|
EventMap::Id | addWindowResizeSystem (System< int, int > system) |
| Add a System to receive when the window resize.
|
|
void | removeWindowResizeSystem (EventMap::Id id) |
| Remove a resize System.
|
|
|
enum class | Stage {
Awake
, Start
, PreUpdate
, Update
,
LateUpdate
, FixedUpdate
, LateFixedUpdate
, Draw
,
Cleanup
} |
| Stages in the Saga engine where systems can be set to run in. Awake is a stage that happens at the very start of an entity. Start happens on the firsts frame. Every frame thereafter, PreUpdate, Update, and LateUpdate is called. FixedUpdate is called on every physics frame, and so is LateFixedUpdate. The Draw stage happens at the end of every frame, where we have to render the output to the screen. More...
|
|
enum | Id : uint64_t |
| Used for id of Systems. More...
|
|
enum class | OtherInput { MOUSE_POS
, SCROLL
, WINDOW_RESIZE
} |
| Types of input events, with button events excluded. More...
|
|
static auto | id_value () -> uint64_t & |
|
EventMap | stagedSystemsMap |
| Map between Stage and Systems.
|
|
std::unordered_map< int, EventMap > | eventSystemsMap |
| Maps entity to an EventMap that maps Event to System.
|
|
EventMap | keyboardInputMap |
|
EventMap | mouseInputMap |
|
EventMap | otherInputMap |
|
A SystemManager where stages and events can be invoked.