Architecture Arcade
Architecture Commune Arcade
Public Member Functions | List of all members
Arcade::ECS::IEventManager Class Referenceabstract

The IEventManager interface. More...

#include <IEventManager.hpp>

Collaboration diagram for Arcade::ECS::IEventManager:
Collaboration graph

Public Member Functions

virtual ~IEventManager ()=default
 
virtual bool eventsIsEmpty () const =0
 Check if there is no event trigered. More...
 
virtual std::pair< bool, std::optional< std::vector< std::optional< std::shared_ptr< IComponent > > > > > isEventTriggered (const std::string &event) const =0
 Check if an event was trigered. More...
 
virtual void addEvent (const std::string &event, std::optional< std::shared_ptr< IComponent >> component=std::nullopt)=0
 Add an event to list of trigered events. More...
 
virtual void clearEvents ()=0
 Remove all events from list of trigered events. More...
 

Detailed Description

The IEventManager interface.

One EventManager to manage all events some events can be created by systems (because events are string) but some events are reserved by IGraph system: "MOUSE_KEY1_PRESSED" "MOUSE_KEY2_PRESSED" "MOUSE_KEY3_PRESSED" "MOUSE_KEY4_PRESSED" "MOUSE_KEY5_PRESSED" "KEY_A_PRESSED" "KEY_B_PRESSED" "KEY_C_PRESSED" "KEY_D_PRESSED" "KEY_E_PRESSED" "KEY_F_PRESSED" "KEY_G_PRESSED" "KEY_H_PRESSED" "KEY_I_PRESSED" "KEY_J_PRESSED" "KEY_K_PRESSED" "KEY_L_PRESSED" "KEY_M_PRESSED" "KEY_N_PRESSED" "KEY_O_PRESSED" "KEY_P_PRESSED" "KEY_Q_PRESSED" "KEY_R_PRESSED" "KEY_S_PRESSED" "KEY_T_PRESSED" "KEY_U_PRESSED" "KEY_V_PRESSED" "KEY_W_PRESSED" "KEY_X_PRESSED" "KEY_Y_PRESSED" "KEY_Z_PRESSED" "KEY_0_PRESSED" "KEY_1_PRESSED" "KEY_2_PRESSED" "KEY_3_PRESSED" "KEY_4_PRESSED" "KEY_5_PRESSED" "KEY_6_PRESSED" "KEY_7_PRESSED" "KEY_8_PRESSED" "KEY_9_PRESSED" "KEY_SPACE_PRESSED" "KEY_ENTER_PRESSED" "KEY_ESC_PRESSED" "KEY_UP_PRESSED" "KEY_DOWN_PRESSED" "KEY_LEFT_PRESSED" "KEY_RIGHT_PRESSED" "KEY_TAB_PRESSED" "KEY_BACKSPACE_PRESSED" "KEY_DELETE_PRESSED" "KEY_SHIFT_PRESSED" "KEY_CTRL_PRESSED" "KEY_ALT_PRESSED" "KEY_F1_PRESSED" "KEY_F2_PRESSED" "KEY_F3_PRESSED" "KEY_F4_PRESSED" "KEY_F5_PRESSED" "KEY_F6_PRESSED" "KEY_F7_PRESSED" "KEY_F8_PRESSED" "KEY_F9_PRESSED" "KEY_F10_PRESSED" "KEY_F11_PRESSED" "KEY_F12_PRESSED" "WINDOW_RESIZE" "WINDOW_MINIMIZE"

Some events are used to change libs such as "CHANGE_GRAPH" to tell core to change the graphical lib used "CHANGE_GAME" to tell core to change the game played "GAME_END" Is the event create by game system to tell core to quit game and go main menu "QUIT" Is the event create by game main menu or grapic lib to tell core to quit program

Constructor & Destructor Documentation

◆ ~IEventManager()

virtual Arcade::ECS::IEventManager::~IEventManager ( )
virtualdefault

Member Function Documentation

◆ addEvent()

virtual void Arcade::ECS::IEventManager::addEvent ( const std::string &  event,
std::optional< std::shared_ptr< IComponent >>  component = std::nullopt 
)
pure virtual

Add an event to list of trigered events.

Parameters
eventThe event to add
componentThe component to add as optional parameter with the event

◆ clearEvents()

virtual void Arcade::ECS::IEventManager::clearEvents ( )
pure virtual

Remove all events from list of trigered events.

◆ eventsIsEmpty()

virtual bool Arcade::ECS::IEventManager::eventsIsEmpty ( ) const
pure virtual

Check if there is no event trigered.

Returns
true if there is no event trigered

◆ isEventTriggered()

virtual std::pair<bool, std::optional< std::vector<std::optional<std::shared_ptr<IComponent> > > > > Arcade::ECS::IEventManager::isEventTriggered ( const std::string &  event) const
pure virtual

Check if an event was trigered.

Parameters
eventThe event to check
Returns
A pair of bool (True if the event was trigered, False if the event was not trigered) and std::vector<std::optional<std::shared_ptr<IComponent>>> (list of the parameter passed as parameter to addEvent method) Why a vector of optional? Because event of same type can be trigered more than one time in one frame

The documentation for this class was generated from the following file: