QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Quasar::EventOf< Type, Categories > Class Template Reference

Base class of each event class, which gives the event its type and its categories. More...

#include <quasar/events/Event.h>

Inheritance diagram for Quasar::EventOf< Type, Categories >:
Quasar::Event

Public Member Functions

EventType GetType () const override
 Returns the type of the event.
EventCategory GetCategories () const override
 Returns all the categories of the event.
Public Member Functions inherited from Quasar::Event
virtual std::string ToString () const
 Returns a readable description of the event, for debugging.
const char * GetName () const
 Returns the name of the type of the event, for example "KeyPressed".
bool IsInCategory (EventCategory category) const
 Returns true if the event belongs to the given category.
bool IsHandled () const
 Returns true if the event was handled.
void SetHandled (bool handled)
 Marks the event as handled, or not handled.

Static Public Member Functions

static constexpr EventType GetStaticType ()
 Returns the type of this event class.

Additional Inherited Members

Protected Member Functions inherited from Quasar::Event
 Event ()=default
 Creates an event that is not handled.

Detailed Description

template<EventType Type, EventCategory Categories>
class Quasar::EventOf< Type, Categories >

Base class of each event class, which gives the event its type and its categories.

For example: class KeyPressedEvent : public EventOf<EventType::KeyPressed, EventCategory::Input | EventCategory::Keyboard>. GetStaticType() gives the type without an event object, which lets the code check the type of an event before converting it.

Member Function Documentation

◆ GetType()

template<EventType Type, EventCategory Categories>
EventType Quasar::EventOf< Type, Categories >::GetType ( ) const
inlineoverridevirtual

Returns the type of the event.

Implements Quasar::Event.

◆ GetCategories()

template<EventType Type, EventCategory Categories>
EventCategory Quasar::EventOf< Type, Categories >::GetCategories ( ) const
inlineoverridevirtual

Returns all the categories of the event.

Implements Quasar::Event.


The documentation for this class was generated from the following file: