Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
toggle_layer_event.h
Go to the documentation of this file.
1 #ifndef TOGGLE_LAYER_EVENT_H
2 #define TOGGLE_LAYER_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 
10 namespace Utility {
15  private:
16  unsigned int layer_number;
17  bool on;
18  public:
19  //= BEGIN SCRIPTABLE
20 
27  ToggleLayerEvent(const unsigned int layer_number, const bool on) : Event(Events::EventType::TOGGLE_LAYER), layer_number(layer_number), on(on) {}
36  static std::shared_ptr<ToggleLayerEvent> create(const unsigned int layer_number, const bool on) { return std::make_shared<ToggleLayerEvent>(layer_number, on); }
42  bool turnOn() const noexcept { return on; }
48  unsigned int getLayerNumber() const noexcept { return layer_number; }
49  //= END SCRIPTABLE
50  };
51 }
52 
53 #endif
Class for event.
Definition: event.h:10
ToggleLayerEvent(const unsigned int layer_number, const bool on)
ToggleLayerEvent Constructor.
Definition: toggle_layer_event.h:27
Definition: event_type.h:42
unsigned int getLayerNumber() const noexcept
Gets the layer number.
Definition: toggle_layer_event.h:48
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
Class for toggle layer event.
Definition: toggle_layer_event.h:14
bool turnOn() const noexcept
Turn the layer on?
Definition: toggle_layer_event.h:42
Event(const EventType &type)
Event constructor.
Definition: event.h:21
static std::shared_ptr< ToggleLayerEvent > create(const unsigned int layer_number, const bool on)
Factory function.
Definition: toggle_layer_event.h:36