Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::Event Class Referenceabstract

Abstract base class for all events in Raven. More...

#include <Event.h>

Inheritance diagram for Raven::Event:
Raven::AppRenderEvent Raven::AppTickEvent Raven::AppUpdateEvent Raven::KeyEvent Raven::MouseButtonEvent Raven::MouseMovedEvent Raven::MouseScrolledEvent Raven::WindowCloseEvent Raven::WindowResizeEvent

Public Member Functions

virtual ~Event ()=default
virtual EventType GetEventType () const =0
 Returns the runtime event type.
virtual const char * GetName () const =0
 Returns the name of the event.
virtual EventCategory GetCategoryFlags () const =0
 Returns the category flags of the event.
virtual std::string ToString () const
 Converts the event to a string for logging or debugging.
bool IsInCategory (EventCategory category) const
 Checks if the event belongs to the specified category.

Public Attributes

bool Handled = false
 Indicates whether the event has been handled.

Detailed Description

Abstract base class for all events in Raven.

Constructor & Destructor Documentation

◆ ~Event()

virtual Raven::Event::~Event ( )
virtualdefault

Member Function Documentation

◆ GetCategoryFlags()

virtual EventCategory Raven::Event::GetCategoryFlags ( ) const
nodiscardpure virtual

Returns the category flags of the event.

Returns
Bitmask of EventCategory flags.

◆ GetEventType()

virtual EventType Raven::Event::GetEventType ( ) const
nodiscardpure virtual

Returns the runtime event type.

Returns
The EventType of the event.

◆ GetName()

virtual const char * Raven::Event::GetName ( ) const
nodiscardpure virtual

Returns the name of the event.

Returns
A null-terminated string representing the event name.

◆ IsInCategory()

bool Raven::Event::IsInCategory ( EventCategory category) const
inlinenodiscard

Checks if the event belongs to the specified category.

Parameters
categoryThe category flag to test.
Returns
True if the event is in the given category.

◆ ToString()

virtual std::string Raven::Event::ToString ( ) const
inlinenodiscardvirtual

Converts the event to a string for logging or debugging.

Returns
A string representation (defaults to event name).

Reimplemented in Raven::KeyPressedEvent, Raven::KeyReleasedEvent, Raven::MouseButtonPressedEvent, Raven::MouseButtonReleasedEvent, Raven::MouseMovedEvent, Raven::MouseScrolledEvent, and Raven::WindowResizeEvent.

Member Data Documentation

◆ Handled

bool Raven::Event::Handled = false

Indicates whether the event has been handled.


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