Colobot
|
Event sent by system, interface or game. More...
#include <event.h>
Public Member Functions | |
Event (EventType type=EVENT_NULL) | |
Event (const Event &)=delete | |
Event & | operator= (const Event &)=delete |
Event (Event &&other) | |
Event & | operator= (Event &&other) |
template<typename EventDataSubclass > | |
EventDataSubclass * | GetData () |
Convenience function for getting appropriate EventData subclass. More... | |
template<typename EventDataSubclass > | |
const EventDataSubclass * | GetData () const |
Convenience function for getting appropriate EventData subclass. More... | |
Event | Clone () const |
Returns a clone of this event. More... | |
Public Attributes | |
EventType | type |
Type of event. More... | |
float | rTime |
Math::Vector | motionInput |
Math::Vector | cameraInput |
unsigned int | kmodState |
Math::Point | mousePos |
unsigned int | mouseButtonsState |
long | customParam |
std::unique_ptr< EventData > | data |
Additional data for some events. More... | |
Event sent by system, interface or game.
Event is described by its type (EventType) and anonymous union that contains additional data about the event. Different members of the union are filled with different event types. With some events, nothing is filled (it's zeroed out). The union contains roughly the same information as SDL_Event struct but packaged to independent structs and fields.
|
inline |
Convenience function for getting appropriate EventData subclass.
|
inline |
Convenience function for getting appropriate EventData subclass.
|
inline |
Returns a clone of this event.
EventType Event::type |
Type of event.
float Event::rTime |
Relative time since last EVENT_FRAME Scope: only EVENT_FRAME events
Math::Vector Event::motionInput |
Math::Vector Event::cameraInput |
unsigned int Event::kmodState |
Current state of keyboard modifier keys: bitmask made of KEY_MOD(...) macro values (from common/key.h) Scope: all system events
Math::Point Event::mousePos |
Current position of mouse cursor in interface coords Scope: all system events
unsigned int Event::mouseButtonsState |
Current state of mouse buttons: bitmask of MouseButton enum values Scope: all system events
long Event::customParam |
Custom parameter that may be set for some events Scope: some interface events
std::unique_ptr<EventData> Event::data |
Additional data for some events.