uBind Class Reference

#include <uInput.h>

Inheritance diagram for uBind:

Inheritance graph
[legend]
Collaboration diagram for uBind:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 uBind (uAction *a)
 uBind (std::istream &s)
virtual ~uBind ()
virtual void Write (std::ostream &s)
virtual bool CheckPlayer (int p)=0
bool Activate (REAL x, bool delayed)
void HanldeDelayed ()
bool IsDoubleBind (uInput const *input)
 checks if the sym is used for double binding, return true

Public Attributes

uActionact
 the time of the last usage

Private Member Functions

virtual bool Delayable ()=0
virtual bool DoActivate (REAL x)=0

Private Attributes

REAL lastValue_
REAL delayedValue_
uInput const * lastInput_
double lastTime_
 the last input used to activate this

Friends

class uMenuItemInput


Detailed Description

Definition at line 142 of file uInput.h.


Constructor & Destructor Documentation

uBind::uBind ( uAction a  ) 

Definition at line 678 of file uInput.cpp.

uBind::uBind ( std::istream &  s  ) 

Definition at line 680 of file uInput.cpp.

References act, and uAction::Find().

00681                          : lastValue_(0), delayedValue_(0), lastInput_(0), lastTime_(-1), act(NULL)
00682 {
00683     std::string name;
00684     s >> name;
00685     act = uAction::Find( name.c_str() );

Here is the call graph for this function:

uBind::~uBind (  )  [virtual]

Definition at line 676 of file uInput.cpp.


Member Function Documentation

virtual bool uBind::Delayable (  )  [private, pure virtual]

Implemented in uBindPlayer.

Referenced by Activate().

Here is the caller graph for this function:

virtual bool uBind::DoActivate ( REAL  x  )  [private, pure virtual]

Implemented in uBindPlayer.

Referenced by Activate(), and HanldeDelayed().

Here is the caller graph for this function:

void uBind::Write ( std::ostream &  s  )  [virtual]

Reimplemented in uBindPlayer.

Definition at line 687 of file uInput.cpp.

References act, and uAction::internalName.

Referenced by uBindPlayer::Write().

00688                               {
00689     s << act->internalName << '\t';

Here is the caller graph for this function:

virtual bool uBind::CheckPlayer ( int  p  )  [pure virtual]

Implemented in uBindPlayer.

Referenced by uMenuItemInput::Event(), and uMenuItemInput::Render().

Here is the caller graph for this function:

bool uBind::Activate ( REAL  x,
bool  delayed 
)

Definition at line 695 of file uInput.cpp.

References Delayable(), delayedValue_, DoActivate(), and lastValue_.

Referenced by su_ClearKeys(), su_HandleEvent(), and su_InputSync().

00697 {
00698     delayedValue_ = x;
00699 
00700     if ( !delayed || !Delayable() )
00701     {
00702         lastValue_ = x;
00703         return this->DoActivate( x );
00704     }
00705 
00706     return true;

Here is the call graph for this function:

Here is the caller graph for this function:

void uBind::HanldeDelayed (  ) 

Definition at line 708 of file uInput.cpp.

References delayedValue_, DoActivate(), and lastValue_.

Referenced by su_HandleDelayedEvents().

00710 {
00711     if ( lastValue_ != delayedValue_ )
00712     {
00713         lastValue_ = delayedValue_;
00714         this->DoActivate( delayedValue_ );
00715     }

Here is the call graph for this function:

Here is the caller graph for this function:

bool uBind::IsDoubleBind ( uInput const *  input  ) 

checks if the sym is used for double binding, return true

Definition at line 719 of file uInput.cpp.

References lastInput_, lastTime_, su_doubleBindTimeout, and tSysTimeFloat().

Referenced by su_HandleEvent().

00721 {
00722     double currentTime = tSysTimeFloat();
00723 
00724     // if a different key was used for this action a short while ago, give alarm.
00725     bool ret = ( su_doubleBindTimeout > 0 && input != lastInput_ && currentTime - lastTime_ < su_doubleBindTimeout );
00726 
00727     // store last usage
00728     lastInput_ = input;
00729     lastTime_ = currentTime;
00730 
00731     // return result
00732     return ret;

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class uMenuItemInput [friend]

Definition at line 144 of file uInput.h.


Member Data Documentation

REAL uBind::lastValue_ [private]

Definition at line 148 of file uInput.h.

Referenced by Activate(), and HanldeDelayed().

REAL uBind::delayedValue_ [private]

Definition at line 149 of file uInput.h.

Referenced by Activate(), and HanldeDelayed().

uInput const* uBind::lastInput_ [private]

Definition at line 151 of file uInput.h.

Referenced by IsDoubleBind().

double uBind::lastTime_ [private]

the last input used to activate this

Definition at line 152 of file uInput.h.

Referenced by IsDoubleBind().

uAction* uBind::act

the time of the last usage

Definition at line 155 of file uInput.h.

Referenced by uBindPlayer::DoActivate(), uMenuItemInput::Event(), uActionGlobal::IsBreakingGlobalBind(), uBindPlayer::NewBind(), uMenuItemInput::Render(), su_HandleEvent(), su_InputSync(), uBind(), and Write().


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 00:00:03 2008 for Armagetron Advanced by  doxygen 1.5.4