Orxonox: orxonox::PlayerInfo Class Reference

# orxonox::PlayerInfo Class Reference

`#include <src/orxonox/objects/infos/PlayerInfo.h>`

Inheritance diagram for orxonox::PlayerInfo:

List of all members.

## 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_

## Constructor & Destructor Documentation

orxonox::PlayerInfo::PlayerInfo | ( | BaseObject * | creator | ) |

References bHumanPlayer_, bLocalPlayer_, bReadyToSpawn_, bSetUnreadyAfterSpawn_, clientID_, orxonox::CLIENTID_UNKNOWN, controllableEntity_, controllableEntityID_, controller_, gtinfo_, gtinfoID_, orxonox::OBJECTID_UNKNOWN, RegisterObject, registerVariables(), and updateGametypeInfo().

orxonox::PlayerInfo::~PlayerInfo | ( |  | ) | `[virtual]`

References controller_, orxonox::BaseObject::getGametype(), orxonox::BaseObject::isInitialized(), orxonox::Gametype::playerLeft(), and stopControl().

## Member Function Documentation

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]`

References changedController(), controllableEntity_, controller_, defaultController_, orxonox::Controller::setControllableEntity(), and orxonox::Controller::setPlayer().

Referenced by orxonox::Bot::Bot(), orxonox::HumanPlayer::networkcallback_clientIDchanged(), and orxonox::PongBot::PongBot().

unsigned int orxonox::PlayerInfo::getClientID | ( |  | ) | const`[inline]`

Referenced by orxonox::HumanPlayer::getPacketLossRatio(), orxonox::HumanPlayer::getPing(), orxonox::Gametype::pawnKilled(), orxonox::Level::playerEntered(), and orxonox::Level::playerLeft().

ControllableEntity* orxonox::PlayerInfo::getControllableEntity | ( |  | ) | const`[inline]`

Referenced by orxonox::ControllableEntity::networkcallback_changedplayerID(), and orxonox::GametypeStatus::tick().

Controller* orxonox::PlayerInfo::getController | ( |  | ) | const`[inline]`

Referenced by orxonox::Pong::spawnPlayer().

const GametypeInfo* orxonox::PlayerInfo::getGametypeInfo | ( |  | ) | const`[inline]`

Referenced by orxonox::AnnounceMessage::announcemessage(), orxonox::DeathMessage::deathmessage(), orxonox::KillMessage::killmessage(), orxonox::GametypeStatus::tick(), and updateGametypeInfo().

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).

Returns:
  True was the object is initialized

Reimplemented from orxonox::BaseObject.

Implemented in orxonox::Bot, and orxonox::HumanPlayer.

Referenced by changedGametype(), and changedName().

bool orxonox::PlayerInfo::isLocalPlayer | ( |  | ) | const`[inline]`

Referenced by orxonox::HumanPlayer::changedGametype(), orxonox::HumanPlayer::configvaluecallback_changednick(), orxonox::ControllableEntity::setPlayer(), orxonox::HumanPlayer::updateGametypeHUD(), and orxonox::HumanPlayer::updateHumanHUD().

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().

## Member Data Documentation

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 orxonox::HumanPlayer::networkcallback_clientIDchanged(), PlayerInfo(), orxonox::HumanPlayer::registerVariables(), and orxonox::HumanPlayer::setClientID().

ControllableEntity* orxonox::PlayerInfo::controllableEntity_`[private]`

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().

SubclassIdentifier<Controller> orxonox::PlayerInfo::defaultController_`[protected]`

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().

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

- src/orxonox/objects/infos/PlayerInfo.h
- src/orxonox/objects/infos/PlayerInfo.cc