Controler Class Reference

Base class defining a storage for control state and events. More...

#include <Control.h>

Inheritance diagram for Controler:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Controler ()
ControlStategetControlState ()
const ControlStategetControlState () const
ControlEventList::const_iterator getEventBegin () const
ControlEventList::const_iterator getEventEnd () const
void clearEvents ()
void clearAxis ()
void clear ()
Program controled events helpers.
These methods are useful for AI since they're AI's entry point.

void doSwitch (double curTime, ControlState::ESwitchId switchId, int unmappedKey, bool pushed)
 Push down or release a switch.
void doSwitchPush (double curTime, ControlState::ESwitchId switchId, int unmappedKey)
 Push down a switch (and keep it down).
void doSwitchRelease (double curTime, ControlState::ESwitchId switchId, int unmappedKey)
 Release a switch.
void doSwitchPR (double curTime, ControlState::ESwitchId switchId, int unmappedKey)
 Do as if a switch (key or button) was pressed and immediatly released.
void axisMove (double curTime, ControlState::EAxisId axisId, float movement)
 Do as if an axis was moved.

Protected Attributes

ControlState state
 Current state of controls.
ControlEventList vEvents
 Events "stack" (Events should be read all at once, and the list cleared afterwards).
TNL::EventConnectionpConnection
 Connection for sending events.

Static Protected Attributes

static const UINT INITIAL_EVENTS_SIZE = 8
 Initial size of vEvents (4 seems ok, 8 is default (avoids reallocation)).


Detailed Description

Base class defining a storage for control state and events.

Please remind to call clearEvents() and clearAxis() on each frame (GFX, physics or anything else that "consumes" data).

Author:
Sukender

Definition at line 284 of file Control.h.


Constructor & Destructor Documentation

Controler::Controler (  )  [inline]

Definition at line 286 of file Control.h.

References INITIAL_EVENTS_SIZE, and vEvents.


Member Function Documentation

void Controler::axisMove ( double  curTime,
ControlState::EAxisId  axisId,
float  movement 
) [inline]

Do as if an axis was moved.

Definition at line 324 of file Control.h.

References ControlState::addToAxis(), state, and vEvents.

void Controler::clear (  )  [inline]

Definition at line 294 of file Control.h.

References ControlState::resetAllAxis(), state, and vEvents.

void Controler::clearAxis (  )  [inline]

Definition at line 293 of file Control.h.

References ControlState::resetAllAxis(), and state.

void Controler::clearEvents (  )  [inline]

Definition at line 292 of file Control.h.

References vEvents.

Referenced by HumanMatrixGetter::handleFrame().

void Controler::doSwitch ( double  curTime,
ControlState::ESwitchId  switchId,
int  unmappedKey,
bool  pushed 
) [inline]

Push down or release a switch.

Definition at line 301 of file Control.h.

References state, and vEvents.

void Controler::doSwitchPR ( double  curTime,
ControlState::ESwitchId  switchId,
int  unmappedKey 
) [inline]

Do as if a switch (key or button) was pressed and immediatly released.

Definition at line 317 of file Control.h.

References state, and vEvents.

void Controler::doSwitchPush ( double  curTime,
ControlState::ESwitchId  switchId,
int  unmappedKey 
) [inline]

Push down a switch (and keep it down).

Definition at line 307 of file Control.h.

References state, and vEvents.

void Controler::doSwitchRelease ( double  curTime,
ControlState::ESwitchId  switchId,
int  unmappedKey 
) [inline]

Release a switch.

Definition at line 312 of file Control.h.

References state, and vEvents.

const ControlState& Controler::getControlState (  )  const [inline]

Definition at line 288 of file Control.h.

References state.

ControlState& Controler::getControlState (  )  [inline]

Definition at line 287 of file Control.h.

References state.

Referenced by HumanMatrixGetter::handleFrame().

ControlEventList::const_iterator Controler::getEventBegin (  )  const [inline]

Definition at line 290 of file Control.h.

References vEvents.

Referenced by HumanMatrixGetter::handleFrame().

ControlEventList::const_iterator Controler::getEventEnd (  )  const [inline]

Definition at line 291 of file Control.h.

References vEvents.

Referenced by HumanMatrixGetter::handleFrame().


Member Data Documentation

const UINT Controler::INITIAL_EVENTS_SIZE = 8 [static, protected]

Initial size of vEvents (4 seems ok, 8 is default (avoids reallocation)).

Definition at line 344 of file Control.h.

Referenced by Controler().

Connection for sending events.

Definition at line 348 of file Control.h.

Referenced by ControlMapper::processHandlerLists().

Events "stack" (Events should be read all at once, and the list cleared afterwards).

Definition at line 346 of file Control.h.

Referenced by axisMove(), clear(), clearEvents(), Controler(), doSwitch(), doSwitchPR(), doSwitchPush(), doSwitchRelease(), getEventBegin(), getEventEnd(), and ControlMapper::handle().


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

Generated on Sun Jan 17 11:39:26 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9