uBindPlayer Class Reference

#include <uInput.h>

Inheritance diagram for uBindPlayer:

Inheritance graph
[legend]
Collaboration diagram for uBindPlayer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~uBindPlayer ()
virtual bool CheckPlayer (int p)
virtual void Write (std::ostream &s)

Static Public Member Functions

static uBindPlayerNewBind (uAction *action, int player)
static uBindPlayerNewBind (std::istream &s)
static bool IsKeyWord (const char *n)

Private Member Functions

virtual bool Delayable ()
virtual bool DoActivate (REAL x)
 uBindPlayer (uAction *a, int p)

Private Attributes

int ePlayer


Detailed Description

Definition at line 205 of file uInput.h.


Constructor & Destructor Documentation

uBindPlayer::uBindPlayer ( uAction a,
int  p 
) [private]

Definition at line 1388 of file uInput.cpp.

uBindPlayer::~uBindPlayer (  )  [virtual]

Definition at line 1390 of file uInput.cpp.


Member Function Documentation

bool uBindPlayer::Delayable (  )  [private, virtual]

Implements uBind.

Definition at line 1442 of file uInput.cpp.

01444 {
01445     return ( ePlayer!=0 );

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

Implements uBind.

Definition at line 1447 of file uInput.cpp.

References uPlayerPrototype::Act(), uBind::act, GlobalAct(), and uPlayerPrototype::PlayerConfig().

01448                                   {
01449     if (ePlayer==0)
01450         return  GlobalAct(act,x);
01451     else
01452         return uPlayerPrototype::PlayerConfig(ePlayer-1)->Act(act,x);

Here is the call graph for this function:

uBindPlayer * uBindPlayer::NewBind ( uAction action,
int  player 
) [static]

Definition at line 1407 of file uInput.cpp.

References uBind::act, ePlayer, uInput::GetBind(), su_inputs, and tNEW.

Referenced by uMenuItemInput::Event(), NewBind(), and tConfItem_key::ReadVal().

01409 {
01410     // see if the bind has an alias
01411     for ( uInputs::const_iterator i = su_inputs.begin(); i != su_inputs.end(); ++i )
01412     {
01413         uInput * input = *i;
01414         uBind * old = input->GetBind();
01415 
01416         // compare action
01417         if ( old && old->act == action )
01418         {
01419             uBindPlayer * oldPlayer = dynamic_cast< uBindPlayer * >( old );
01420             if ( oldPlayer && oldPlayer->ePlayer == player )
01421                 return oldPlayer;
01422         }
01423     }
01424 
01425     // no alias found, return new bind
01426     return tNEW(uBindPlayer)( action, player );

Here is the call graph for this function:

Here is the caller graph for this function:

uBindPlayer * uBindPlayer::NewBind ( std::istream &  s  )  [static]

Definition at line 1392 of file uInput.cpp.

References uBind::act, uAction::Find(), and NewBind().

01394 {
01395     // read action
01396     std::string actionName;
01397     s >> actionName;
01398     uAction * act = uAction::Find( actionName.c_str() );
01399 
01400     // read player ID
01401     int player;
01402     s >> player;
01403 
01404     // delegate
01405     return NewBind( act, player );

Here is the call graph for this function:

bool uBindPlayer::IsKeyWord ( const char *  n  )  [static]

Definition at line 1428 of file uInput.cpp.

Referenced by tConfItem_key::ReadVal().

01429                                         {
01430     return !strcmp(n,Player_keyword);

Here is the caller graph for this function:

bool uBindPlayer::CheckPlayer ( int  p  )  [virtual]

Implements uBind.

Definition at line 1432 of file uInput.cpp.

01433                                   {
01434     return p==ePlayer;

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

Reimplemented from uBind.

Definition at line 1436 of file uInput.cpp.

References uBind::Write().

01437                                     {
01438     s << Player_keyword << '\t';
01439     uBind::Write(s);
01440     s << ePlayer;

Here is the call graph for this function:


Member Data Documentation

int uBindPlayer::ePlayer [private]

Definition at line 206 of file uInput.h.

Referenced by NewBind().


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