IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Abstract base class for events. More...
Public Member Functions | |
Event_Base (EVENTTYPE _type, unsigned int _delay=0) | |
EventHandler * | GetCaller () |
Returns the EventHandler at which this event originated. | |
virtual bool | operator== (Event_Base *e) |
Compare whether two events are the same. More... | |
virtual bool | operator!= (Event_Base *e) |
virtual bool | operator== (EVENTTYPE type) |
Allows to compare an event directly to an EVENTTYPE. More... | |
EVENTPIPE | GetEventPipe () |
Protected Member Functions | |
virtual bool | sendMe () |
Used to determine whether the event should be sent by the event generator. More... | |
Protected Attributes | |
unsigned int | delay |
How many calls of ProcessEvents() on the event generator the event should be delayed. | |
EventHandler * | caller |
Stores the EventHandler at which the event originated. | |
EVENTTYPE | eventtype |
The type of this event. | |
EVENTPIPE | pipe |
The pipe the event travels in (unless it was relayed). This is set by the EventHandler itself. | |
Friends | |
class | EventGenerator |
Abstract base class for events.
derive all events from this class. events should have a unique identifier which you should add to the enum in events.h, and carry all neccessary information for the particular event with them.
Event_Base::Event_Base | ( | EVENTTYPE | _type, |
unsigned int | _delay = 0 |
||
) |
_type | The identifier for this kind of event |
_delay | The event will fire this many frames after its creation |
|
inline |
This is the event pipe the event is travelling in, and is intended to be used by EventHandlers in case they need to determine where an event came from and where it's going.
|
virtual |
|
virtual |
Compare whether two events are the same.
this comparison usually depends on event type, but may have to consider other properties depending on the kind of event. Overload to inheriting classes if necessary. Most common events are the same event if they are of the same type. Events that carry information might need more distinction!
Reimplemented in AnimationEvent_Base, and ConsumableAddedEvent.
|
virtual |
Allows to compare an event directly to an EVENTTYPE.
|
protectedvirtual |
Used to determine whether the event should be sent by the event generator.
Decrements the delay by 1 when called
Reimplemented in Event_Timed.