Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::Event Class Referenceabstract

Abstract base class for all events. More...

#include <Event.h>

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

Public Member Functions

virtual int GetCategoryFlags () const =0
 Get the category flags of the event.
 
virtual EventType GetEventType () const =0
 Get the type of the event.
 
virtual const char * GetName () const =0
 Get the name of the event.
 
bool IsInCategory (EventCategory category)
 Check if the event is in a specific category.
 
virtual std::string ToString () const
 Convert the event to a string representation.
 
virtual ~Event ()=default
 

Public Attributes

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

Friends

class EventDispatcher
 

Detailed Description

Abstract base class for all events.

Constructor & Destructor Documentation

◆ ~Event()

virtual Muto::Event::~Event ( )
virtualdefault

Member Function Documentation

◆ GetCategoryFlags()

virtual int Muto::Event::GetCategoryFlags ( ) const
pure virtual

Get the category flags of the event.

Referenced by IsInCategory().

◆ GetEventType()

virtual EventType Muto::Event::GetEventType ( ) const
pure virtual

Get the type of the event.

Referenced by Muto::EventDispatcher::Dispatch().

◆ GetName()

virtual const char * Muto::Event::GetName ( ) const
pure virtual

Get the name of the event.

Referenced by ToString().

◆ IsInCategory()

bool Muto::Event::IsInCategory ( EventCategory  category)
inline

Check if the event is in a specific category.

54 {
55 return GetCategoryFlags() & category;
56 }
virtual int GetCategoryFlags() const =0
Get the category flags of the event.
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References GetCategoryFlags().

Referenced by Muto::ImGuiLayer::OnEvent().

◆ ToString()

virtual std::string Muto::Event::ToString ( ) const
inlinevirtual

Convert the event to a string representation.

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

50{ return GetName(); }
virtual const char * GetName() const =0
Get the name of the event.

References GetName().

Referenced by Muto::format_as().

Friends And Related Symbol Documentation

◆ EventDispatcher

Member Data Documentation

◆ Handled

bool Muto::Event::Handled = false

Indicates whether the event has been handled.

Referenced by Muto::EventDispatcher::Dispatch(), Muto::Application::OnEvent(), and Muto::ImGuiLayer::OnEvent().


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