galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Event.cpp
Go to the documentation of this file.
1
7
8#include "Event.hpp"
9
10namespace galaxy
11{
12 Event::Event() noexcept
13 : m_handled {false}
14 {
15 }
16
17 Event::Event(Event&& e) noexcept
18 {
19 this->m_handled = e.m_handled;
20 }
21
23 {
24 if (this != &e)
25 {
26 this->m_handled = e.m_handled;
27 }
28
29 return *this;
30 }
31
32 Event::Event(const Event& e) noexcept
33 {
34 this->m_handled = e.m_handled;
35 }
36
37 Event& Event::operator=(const Event& e) noexcept
38 {
39 if (this != &e)
40 {
41 this->m_handled = e.m_handled;
42 }
43
44 return *this;
45 }
46
47 Event::~Event() noexcept
48 {
49 }
50
51 void Event::consume() noexcept
52 {
53 m_handled = true;
54 }
55
56 bool Event::consumed() const noexcept
57 {
58 return m_handled;
59 }
60} // namespace galaxy
Base type of all events.
Definition Event.hpp:17
Event() noexcept
Constructor.
Definition Event.cpp:12
virtual ~Event() noexcept
Destructor.
Definition Event.cpp:47
Event & operator=(Event &&) noexcept
Move assignment operator.
Definition Event.cpp:22
bool consumed() const noexcept
Is this event already consumed?
Definition Event.cpp:56
void consume() noexcept
Mark this event as consumed.
Definition Event.cpp:51
bool m_handled
Keeps track if event has been used already.
Definition Event.hpp:66
Application.hpp galaxy.