#include <uInput.h>
Public Member Functions | |
virtual | ~uBindPlayer () |
virtual bool | CheckPlayer (int p) |
virtual void | Write (std::ostream &s) |
Static Public Member Functions | |
static uBindPlayer * | NewBind (uAction *action, int player) |
static uBindPlayer * | NewBind (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 |
Definition at line 205 of file uInput.h.
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.
bool uBindPlayer::Delayable | ( | ) | [private, virtual] |
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);
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 );
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 );
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);
bool uBindPlayer::CheckPlayer | ( | int | p | ) | [virtual] |
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;
int uBindPlayer::ePlayer [private] |