#include <src/orxonox/objects/infos/PlayerInfo.h>
Public Member Functions | |
virtual void | changedControllableEntity () |
virtual void | changedController () |
virtual void | changedGametype () |
virtual void | changedName () |
This function gets called if the name of the object changes. | |
unsigned int | getClientID () const |
ControllableEntity * | getControllableEntity () const |
Controller * | getController () const |
const GametypeInfo * | getGametypeInfo () const |
virtual float | getPacketLossRatio () const =0 |
virtual float | getPing () const =0 |
bool | isHumanPlayer () const |
virtual bool | isInitialized () const =0 |
Returns if the object was initialized (passed the object registration). | |
bool | isLocalPlayer () const |
bool | isReadyToSpawn () const |
PlayerInfo (BaseObject *creator) | |
void | registerVariables () |
void | setReadyToSpawn (bool bReady) |
void | startControl (ControllableEntity *entity) |
void | stopControl () |
virtual | ~PlayerInfo () |
Protected Member Functions | |
void | createController () |
Protected Attributes | |
bool | bHumanPlayer_ |
bool | bLocalPlayer_ |
bool | bSetUnreadyAfterSpawn_ |
unsigned int | clientID_ |
SubclassIdentifier< Controller > | defaultController_ |
Private Member Functions | |
void | networkcallback_changedcontrollableentityID () |
void | networkcallback_changedgtinfoID () |
void | updateGametypeInfo () |
Private Attributes | |
bool | bReadyToSpawn_ |
ControllableEntity * | controllableEntity_ |
unsigned int | controllableEntityID_ |
Controller * | controller_ |
const GametypeInfo * | gtinfo_ |
unsigned int | gtinfoID_ |
orxonox::PlayerInfo::PlayerInfo | ( | BaseObject * | creator | ) |
orxonox::PlayerInfo::~PlayerInfo | ( | ) | [virtual] |
virtual void orxonox::PlayerInfo::changedControllableEntity | ( | ) | [inline, virtual] |
Referenced by startControl(), and stopControl().
virtual void orxonox::PlayerInfo::changedController | ( | ) | [inline, virtual] |
Referenced by createController().
void orxonox::PlayerInfo::changedGametype | ( | ) | [virtual] |
Reimplemented from orxonox::BaseObject.
Reimplemented in orxonox::HumanPlayer.
References orxonox::BaseObject::getGametype(), orxonox::BaseObject::getOldGametype(), isInitialized(), orxonox::Gametype::playerEntered(), orxonox::Gametype::playerLeft(), orxonox::Gametype::playerSwitched(), orxonox::Gametype::playerSwitchedBack(), and updateGametypeInfo().
Referenced by orxonox::HumanPlayer::changedGametype().
void orxonox::PlayerInfo::changedName | ( | ) | [virtual] |
This function gets called if the name of the object changes.
Reimplemented from orxonox::BaseObject.
References orxonox::BaseObject::getGametype(), isInitialized(), orxonox::Gametype::playerChangedName(), and SUPER.
Referenced by registerVariables().
void orxonox::PlayerInfo::createController | ( | ) | [protected] |
unsigned int orxonox::PlayerInfo::getClientID | ( | ) | const [inline] |
ControllableEntity* orxonox::PlayerInfo::getControllableEntity | ( | ) | const [inline] |
Controller* orxonox::PlayerInfo::getController | ( | ) | const [inline] |
Referenced by orxonox::Pong::spawnPlayer().
const GametypeInfo* orxonox::PlayerInfo::getGametypeInfo | ( | ) | const [inline] |
virtual float orxonox::PlayerInfo::getPacketLossRatio | ( | ) | const [pure virtual] |
Implemented in orxonox::Bot, and orxonox::HumanPlayer.
virtual float orxonox::PlayerInfo::getPing | ( | ) | const [pure virtual] |
Implemented in orxonox::Bot, and orxonox::HumanPlayer.
bool orxonox::PlayerInfo::isHumanPlayer | ( | ) | const [inline] |
Referenced by orxonox::ControllableEntity::setPlayer().
virtual bool orxonox::PlayerInfo::isInitialized | ( | ) | const [pure virtual] |
Returns if the object was initialized (passed the object registration).
Reimplemented from orxonox::BaseObject.
Implemented in orxonox::Bot, and orxonox::HumanPlayer.
Referenced by changedGametype(), and changedName().
bool orxonox::PlayerInfo::isLocalPlayer | ( | ) | const [inline] |
bool orxonox::PlayerInfo::isReadyToSpawn | ( | ) | const [inline] |
Referenced by orxonox::GametypeStatus::tick().
void orxonox::PlayerInfo::networkcallback_changedcontrollableentityID | ( | ) | [private] |
References controllableEntityID_, orxonox::Synchronisable::getSynchronisable(), orxonox::OBJECTID_UNKNOWN, startControl(), and stopControl().
Referenced by registerVariables().
void orxonox::PlayerInfo::networkcallback_changedgtinfoID | ( | ) | [private] |
References orxonox::Synchronisable::getSynchronisable(), gtinfo_, gtinfoID_, and orxonox::OBJECTID_UNKNOWN.
Referenced by registerVariables().
void orxonox::PlayerInfo::registerVariables | ( | ) |
Reimplemented in orxonox::HumanPlayer.
References bReadyToSpawn_, changedName(), controllableEntityID_, gtinfoID_, orxonox::BaseObject::name_, networkcallback_changedcontrollableentityID(), networkcallback_changedgtinfoID(), orxonox::Synchronisable::registerVariable(), orxonox::VariableDirection::ToClient, and orxonox::VariableDirection::ToServer.
Referenced by PlayerInfo().
void orxonox::PlayerInfo::setReadyToSpawn | ( | bool | bReady | ) | [inline] |
Referenced by orxonox::Bot::Bot(), and orxonox::Spectator::fire().
void orxonox::PlayerInfo::startControl | ( | ControllableEntity * | entity | ) |
References bReadyToSpawn_, bSetUnreadyAfterSpawn_, changedControllableEntity(), controllableEntity_, controllableEntityID_, controller_, orxonox::Synchronisable::getObjectID(), orxonox::Controller::setControllableEntity(), orxonox::ControllableEntity::setPlayer(), and stopControl().
Referenced by networkcallback_changedcontrollableentityID(), orxonox::ControllableEntity::networkcallback_changedplayerID(), orxonox::Pong::spawnPlayer(), orxonox::Gametype::spawnPlayer(), and orxonox::Gametype::spawnPlayerAsDefaultPawn().
void orxonox::PlayerInfo::stopControl | ( | ) |
References changedControllableEntity(), controllableEntity_, controllableEntityID_, controller_, orxonox::OBJECTID_UNKNOWN, orxonox::ControllableEntity::removePlayer(), and orxonox::Controller::setControllableEntity().
Referenced by orxonox::Pawn::death(), networkcallback_changedcontrollableentityID(), startControl(), orxonox::HumanController::suicide(), orxonox::ControllableEntity::~ControllableEntity(), and ~PlayerInfo().
void orxonox::PlayerInfo::updateGametypeInfo | ( | ) | [private] |
References orxonox::BaseObject::getGametype(), orxonox::Gametype::getGametypeInfo(), getGametypeInfo(), orxonox::Synchronisable::getObjectID(), gtinfo_, gtinfoID_, and orxonox::OBJECTID_UNKNOWN.
Referenced by changedGametype(), and PlayerInfo().
bool orxonox::PlayerInfo::bHumanPlayer_ [protected] |
Referenced by orxonox::Bot::Bot(), orxonox::HumanPlayer::HumanPlayer(), and PlayerInfo().
bool orxonox::PlayerInfo::bLocalPlayer_ [protected] |
Referenced by orxonox::Bot::Bot(), orxonox::HumanPlayer::networkcallback_clientIDchanged(), and PlayerInfo().
bool orxonox::PlayerInfo::bReadyToSpawn_ [private] |
Referenced by PlayerInfo(), registerVariables(), and startControl().
bool orxonox::PlayerInfo::bSetUnreadyAfterSpawn_ [protected] |
Referenced by orxonox::Bot::Bot(), PlayerInfo(), and startControl().
unsigned int orxonox::PlayerInfo::clientID_ [protected] |
Referenced by createController(), PlayerInfo(), startControl(), and stopControl().
unsigned int orxonox::PlayerInfo::controllableEntityID_ [private] |
Referenced by networkcallback_changedcontrollableentityID(), PlayerInfo(), registerVariables(), startControl(), and stopControl().
Controller* orxonox::PlayerInfo::controller_ [private] |
Referenced by createController(), PlayerInfo(), startControl(), stopControl(), and ~PlayerInfo().
Referenced by orxonox::Bot::Bot(), createController(), orxonox::HumanPlayer::HumanPlayer(), and orxonox::PongBot::PongBot().
const GametypeInfo* orxonox::PlayerInfo::gtinfo_ [private] |
Referenced by networkcallback_changedgtinfoID(), PlayerInfo(), and updateGametypeInfo().
unsigned int orxonox::PlayerInfo::gtinfoID_ [private] |
Referenced by networkcallback_changedgtinfoID(), PlayerInfo(), registerVariables(), and updateGametypeInfo().