R-Type  2
Doom but in better
Loading...
Searching...
No Matches
EventSystem.cpp File Reference
#include <sstream>
#include "EventSystem.hpp"
#include "SpawnSystem.hpp"
#include "MovementSystem.hpp"
#include "WeaponSystem.hpp"
#include "PlayerMiscellaneous.hpp"
Include dependency graph for EventSystem.cpp:

Go to the source code of this file.

Functions

void event_system (Registry &r)
 Processes events from the queue and performs actions.
 
bool validateAction (const GameMessage &event, Registry &r)
 Validates the action associated with the event.
 
bool performAction (const GameMessage &event, Registry &r)
 Performs the action associated with the event.
 

Function Documentation

◆ event_system()

void event_system ( Registry & r)

Processes events from the queue and performs actions.

This function continuously checks the event queue in the provided Registry instance and processes the events one by one. Each event is validated and, if valid, an action is performed based on the event type.

Parameters
rReference to the Registry instance where the event queue is located.

Definition at line 8 of file EventSystem.cpp.

◆ performAction()

bool performAction ( const GameMessage & event,
Registry & r )

Performs the action associated with the event.

This function performs the appropriate action based on the event type.

Parameters
eventThe GameMessage event that dictates the action.
rReference to the Registry instance.
Returns
true if the action was successfully performed, otherwise false.

Definition at line 35 of file EventSystem.cpp.

◆ validateAction()

bool validateAction ( const GameMessage & event,
Registry & r )

Validates the action associated with the event.

This function checks whether the action in the given event is valid.

Parameters
eventThe GameMessage event to be validated.
rReference to the Registry instance.
Returns
true if the action is valid, otherwise false.

Definition at line 30 of file EventSystem.cpp.