Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mouse_button_down_event.h
Go to the documentation of this file.
1 #ifndef MOUSE_BUTTON_DOWN_EVENT_H
2 #define MOUSE_BUTTON_DOWN_EVENT_H
3 #include <glm/glm.hpp>
4 #include "events/event.h"
5 #include "events/event_type.h"
6 
7 //= SCRIPTABLE
8 //= SCRIPTABLE BASES Event
9 namespace Input {
14  private:
15  int button;
16  public:
17  //= BEGIN SCRIPTABLE
18 
24  MouseButtonDownEvent(const int button) : Event(Events::EventType::MOUSE_BUTTON_DOWN), button(button) {}
32  static std::shared_ptr<MouseButtonDownEvent> create(const int button) { return std::make_shared<MouseButtonDownEvent>(button); }
38  int getButton() const noexcept { return button; }
39  //= END SCRIPTABLE
40  };
41 }
42 
43 #endif
Class for event.
Definition: event.h:10
Definition: event_type.h:15
Class for mouse button down event.
Definition: mouse_button_down_event.h:13
MouseButtonDownEvent(const int button)
MouseButtonDownEvent constructor.
Definition: mouse_button_down_event.h:24
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
static std::shared_ptr< MouseButtonDownEvent > create(const int button)
Factory function.
Definition: mouse_button_down_event.h:32
int getButton() const noexcept
Gets the button.
Definition: mouse_button_down_event.h:38
Event(const EventType &type)
Event constructor.
Definition: event.h:21