Architecture Arcade
Architecture Commune Arcade
IEventManager.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** Archi Arcade Promo 2026 Toulouse
4 ** File description:
5 ** Manager for the events that will be passed to the systems
6 */
7 
8 #pragma once
9 
10 #include <memory>
11 #include <optional>
12 #include <string>
13 #include <tuple>
14 #include <vector>
15 #include "ArcadeStruct.hpp"
16 #include "IComponent.hpp"
17 
18 namespace Arcade {
19  namespace ECS {
106  public:
107  virtual ~IEventManager() = default;
108 
114  virtual bool eventsIsEmpty() const = 0;
128  virtual std::pair<bool,
129  std::optional<
130  std::vector<std::optional<std::shared_ptr<IComponent>>>>>
131  isEventTriggered(const std::string &event) const = 0;
139  virtual void addEvent(const std::string &event,
140  std::optional<std::shared_ptr<IComponent>> component =
141  std::nullopt) = 0;
145  virtual void clearEvents() = 0;
146  };
147  } // namespace ECS
148 } // namespace Arcade
Definition: ArcadeStruct.hpp:10
The IEventManager interface.
Definition: IEventManager.hpp:105
virtual ~IEventManager()=default
virtual void clearEvents()=0
Remove all events from list of trigered events.
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.
virtual bool eventsIsEmpty() const =0
Check if there is no event trigered.
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.