IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
Event_Base Class Reference

Abstract base class for events. More...

Inheritance diagram for Event_Base:
AnimationEvent_Base CoGHasChangedEvent ConsumableAddedEvent Event_Timed HullShapeRemovedEvent IMS_DockEvent LiftoffEvent RcsChangedEvent SimulationStartedEvent TdPointsChangedEvent ToggleGearEvent TouchdownEvent VesselLayoutChangedEvent VesselVisualCreatedEvent VesselVisualDestroyedEvent

Public Member Functions

 Event_Base (EVENTTYPE _type, unsigned int _delay=0)
 
EventHandlerGetCaller ()
 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.
 
EventHandlercaller
 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
 

Detailed Description

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.

See also
EventHandler.h

Constructor & Destructor Documentation

Event_Base::Event_Base ( EVENTTYPE  _type,
unsigned int  _delay = 0 
)
Parameters
_typeThe identifier for this kind of event
_delayThe event will fire this many frames after its creation

Member Function Documentation

EVENTPIPE Event_Base::GetEventPipe ( )
inline
Returns
The event pipe this event originated in.

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.

bool Event_Base::operator!= ( Event_Base e)
virtual
Returns
!operator==(Event_Base *e)
bool Event_Base::operator== ( Event_Base e)
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!

Returns
True if the event types of both events match, false otherwise

Reimplemented in AnimationEvent_Base, and ConsumableAddedEvent.

bool Event_Base::operator== ( EVENTTYPE  type)
virtual

Allows to compare an event directly to an EVENTTYPE.

Returns
True if the event type of this matches type
bool Event_Base::sendMe ( )
protectedvirtual

Used to determine whether the event should be sent by the event generator.

Decrements the delay by 1 when called

Returns
True if delay is 0, false otherwise

Reimplemented in Event_Timed.


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