3#include "spark/events/Export.h"
5#include "spark/base/Macros.h"
6#include "spark/rtti/HasRtti.h"
33 EventCategoryApplication = BIT(0),
34 EventCategoryInput = BIT(1),
35 EventCategoryKeyboard = BIT(2),
36 EventCategoryMouse = BIT(3),
37 EventCategoryMouseButton = BIT(4)
40#define DEFINE_EVENT_TYPE(type) public: \
41 static EventType StaticType() { return type; } \
42 virtual EventType eventType() const override { return StaticType(); } \
45#define DEFINE_EVENT_CATEGORY(category) public: \
46 virtual int eventCategoryFlags() const override { return category; } \
54 DECLARE_SPARK_RTTI(
Event)
57 explicit Event() =
default;
58 ~Event()
override =
default;
62 Event& operator=(
const Event& other) =
default;
63 Event& operator=(
Event&& other)
noexcept =
default;
69 [[nodiscard]]
virtual EventType
eventType()
const = 0;
82 [[nodiscard]]
bool isInCategory(
const EventCategory& category)
const;
A base class for all events in SPARK.
Definition Event.h:53
virtual int eventCategoryFlags() const =0
Gets the category flags of the event.
virtual EventType eventType() const =0
Gets the type of the event.
The class anything using the RTTI should implement.
Definition HasRtti.h:16