SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::events::Event Class Referenceabstract

A base class for all events in SPARK. More...

#include <Event.h>

Inheritance diagram for spark::events::Event:
spark::rtti::HasRtti spark::events::KeyEvent spark::events::MouseButtonEvent spark::events::MouseMovedEvent spark::events::MouseScrolledEvent spark::events::WindowCloseEvent spark::events::WindowResizeEvent spark::events::KeyPressedEvent spark::events::KeyReleasedEvent spark::events::KeyTypedEvent spark::events::MouseButtonPressedEvent spark::events::MouseButtonReleasedEvent

Public Member Functions

 Event (const Event &other)=default
 
 Event (Event &&other) noexcept=default
 
Eventoperator= (const Event &other)=default
 
Eventoperator= (Event &&other) noexcept=default
 
virtual EventType eventType () const =0
 Gets the type of the event.
 
virtual int eventCategoryFlags () const =0
 Gets the category flags of the event.
 
bool isInCategory (const EventCategory &category) const
 Checks if the event is in the specified category.
 
- Public Member Functions inherited from spark::rtti::HasRtti
 HasRtti (const HasRtti &other)=default
 
 HasRtti (HasRtti &&other) noexcept=default
 
HasRttioperator= (const HasRtti &other)=default
 
HasRttioperator= (HasRtti &&other) noexcept=default
 
virtual RttiBaserttiInstance () const =0
 

Public Attributes

bool handled = false
 

Detailed Description

A base class for all events in SPARK.

Member Function Documentation

◆ eventCategoryFlags()

virtual int spark::events::Event::eventCategoryFlags ( ) const
nodiscardpure virtual

Gets the category flags of the event.

Returns
An int combining the enum values of the corresponding categories of the event.

◆ eventType()

virtual EventType spark::events::Event::eventType ( ) const
nodiscardpure virtual

Gets the type of the event.

Returns
An EventType enum value corresponding to the type of the event.

◆ isInCategory()

bool spark::events::Event::isInCategory ( const EventCategory & category) const
nodiscard

Checks if the event is in the specified category.

Parameters
categoryThe category to check.
Returns
A boolean value indicating whether the event is in the specified category.