|
CeresEngine 0.2.0
A game development framework
|
A type that describes any possible event type. More...
#include <CeresEngine/Input/InputEvent.hpp>
Public Member Functions | |
| AnyInputEvent () noexcept=default | |
| Creates a new empty event. | |
| AnyInputEvent (const KeyEvent &event) noexcept | |
Creates a new event with a KeyEvent struct. | |
| AnyInputEvent (const MouseEvent &event) noexcept | |
Creates a new event with a MouseEvent struct. | |
| AnyInputEvent (const TextEvent &event) noexcept | |
Creates a new event with a TextEvent struct. | |
| AnyInputEvent (const AnyInputEvent &)=default | |
| AnyInputEvent & | operator= (const AnyInputEvent &)=default |
| AnyInputEvent (AnyInputEvent &&) noexcept=default | |
| AnyInputEvent & | operator= (AnyInputEvent &&) noexcept=default |
| ~AnyInputEvent () noexcept=default | |
| PlatformWindow * | getWindow () const noexcept |
| The platform window that triggered the input event, if any. | |
| bool | isValid () const noexcept |
| Checks if the event is valid. | |
| operator bool () const noexcept | |
| Checks if the event is valid. | |
| InputEventType | getEventType () const noexcept |
| Returns the type of the event represented by this AnyEvent structure. | |
| template<typename T > | |
| bool | is () const noexcept |
Checks if the event is of type T. | |
| template<typename T > | |
| const T & | as () const noexcept |
Gets the event as a concrete event of type T. | |
| template<typename T > | |
| T & | as () noexcept |
Gets the event as a concrete event of type T. | |
| bool | isKeyEvent () const noexcept |
Checks if the event is of type KeyEvent. | |
| const KeyEvent & | asKeyEvent () const noexcept |
Gets the event as a concrete event of type KeyEvent. | |
| KeyEvent & | asKeyEvent () noexcept |
Gets the event as a concrete event of type KeyEvent. | |
| bool | isMouseEvent () const noexcept |
Checks if the event is of type MouseEvent. | |
| const MouseEvent & | asMouseEvent () const noexcept |
Gets the event as a concrete event of type MouseEvent. | |
| MouseEvent & | asMouseEvent () noexcept |
Gets the event as a concrete event of type MouseEvent. | |
| bool | isTextEvent () const noexcept |
Checks if the event is of type TextEvent. | |
| const TextEvent & | asTextEvent () const noexcept |
Gets the event as a concrete event of type TextEvent. | |
| TextEvent & | asTextEvent () noexcept |
Gets the event as a concrete event of type TextEvent. | |
Private Types | |
| using | Variant = Variant< std::monostate, KeyEvent, MouseEvent, TextEvent > |
| The variant type used to store the event types. | |
Private Attributes | |
| Variant | mData |
| The variant type used to store the event types. | |
A type that describes any possible event type.
|
private |
The variant type used to store the event types.
|
defaultnoexcept |
Creates a new empty event.
Creates a new event with a KeyEvent struct.
|
inlinenoexcept |
Creates a new event with a MouseEvent struct.
Creates a new event with a TextEvent struct.
|
default |
|
defaultnoexcept |
|
defaultnoexcept |
Gets the event as a concrete event of type T.
Gets the event as a concrete event of type T.
Gets the event as a concrete event of type KeyEvent.
|
inlinenoexcept |
Gets the event as a concrete event of type KeyEvent.
|
inlinenoexcept |
Gets the event as a concrete event of type MouseEvent.
|
inlinenoexcept |
Gets the event as a concrete event of type MouseEvent.
Gets the event as a concrete event of type TextEvent.
|
inlinenoexcept |
Gets the event as a concrete event of type TextEvent.
|
noexcept |
Returns the type of the event represented by this AnyEvent structure.
|
noexcept |
The platform window that triggered the input event, if any.
Some synthetic events can have a ´nullptr´ window.
Checks if the event is of type T.
|
inlinenoexcept |
Checks if the event is of type KeyEvent.
|
inlinenoexcept |
Checks if the event is of type MouseEvent.
|
inlinenoexcept |
Checks if the event is of type TextEvent.
|
noexcept |
Checks if the event is valid.
If not valid, none of it's accessors can be used to convert the AnyEvent into a concrete event type.
|
inlineexplicitnoexcept |
Checks if the event is valid.
If not valid, none of it's accessors can be used to convert the AnyEvent into a concrete event type.
|
defaultnoexcept |
|
default |
|
private |
The variant type used to store the event types.