NRE_ButtonEvent.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <Header/NRE_Math.hpp>
13 
14  #include "../../Input/Buttons/NRE_Buttons.hpp"
15 
20  namespace NRE {
25  namespace Event {
26 
31  class ButtonEvent {
32  private: //Fields
33  ButtonCode code;
34  Math::Point2D<unsigned int> position;
36  public: // Methods
37  //## Constructor ##//
41  ButtonEvent() = delete;
47  ButtonEvent(ButtonCode c, Math::Point2D<unsigned int> const& pos);
48 
49  //## Copy-Constructor ##//
54  ButtonEvent(ButtonEvent const& e) = default;
55 
56  //## Move-Constructor ##//
61  ButtonEvent(ButtonEvent && e) = default;
62 
63  //## Deconstructor ##//
67  ~ButtonEvent() = default;
68 
69  //## Getter ##//
73  inline ButtonCode getCode() const;
77  inline Math::Point2D<unsigned int> const& getPosition() const;
83  inline bool isCode(ButtonCode c) const;
84 
85  //## Assignment Operator ##//
91  ButtonEvent& operator =(ButtonEvent const& e) = default;
97  ButtonEvent& operator =(ButtonEvent && e) = default;
98 
99  //## Comparison Operator ##//
105  bool operator ==(ButtonEvent const& e) const;
106  };
107 
109  }
110  }
111 
112  #include "NRE_ButtonEvent.tpp"
ButtonCode getCode() const
ButtonEvent & operator=(ButtonEvent const &e)=default
Event&#39;s API.
bool operator==(ButtonEvent const &e) const
bool isCode(ButtonCode c) const
Math::Point2D< unsigned int > const & getPosition() const
The NearlyRealEngine&#39;s global namespace.
Manage a button event.
Definition: NRE_ButtonEvent.hpp:31
ButtonCode
Definition: NRE_Buttons.hpp:27