Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
toggle_lights_event.h
Go to the documentation of this file.
1 #ifndef TOGGLE_LIGHTS_EVENT_H
2 #define TOGGLE_LIGHTS_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 {
12  private:
13  bool on;
14  public:
15  //= BEGIN SCRIPTABLE
16 
22  ToggleLightsEvent(const bool on) : Event(Events::EventType::TOGGLE_LIGHTS), on(on) {}
30  static std::shared_ptr<ToggleLightsEvent> create(const bool on) { return std::make_shared<ToggleLightsEvent>(on); }
36  bool turnOn() const noexcept { return on; }
37  //= END SCRIPTABLE
38  };
39 }
40 
41 #endif
Class for event.
Definition: event.h:10
bool turnOn() const noexcept
Turn the lights on?
Definition: toggle_lights_event.h:36
ToggleLightsEvent(const bool on)
ToggleLightsEvent constructor.
Definition: toggle_lights_event.h:22
static std::shared_ptr< ToggleLightsEvent > create(const bool on)
Factory function.
Definition: toggle_lights_event.h:30
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
Definition: event_type.h:41
Definition: toggle_lights_event.h:11
Event(const EventType &type)
Event constructor.
Definition: event.h:21