#include <player.h>

Public Member Functions | |
| Player (const char *id) | |
| virtual | ~Player () |
| const string & | GetName () const |
| void | SetName (const string &name) |
| const string & | GetRaceId () const |
| void | SetRaceId (const string &race_id) |
| const vector3 & | GetColor () const |
| void | SetColor (const vector3 &color) |
| void | SetActive (bool active) |
| bool | IsActive () const |
| bool | IsHyper () const |
| bool | LoadResources () |
| void | UnloadResources () |
| void | CreatePlayerMap (const MapSize &map_size) |
| void | DeletePlayerMap () |
| bool | UpdatePlayerMap (const Unit *unit, bool added) |
| PlayerMap * | GetPlayerMap () const |
| Unit * | NewUnit (const string &prototype_id) |
| Unit * | NewUnit (Prototype *prototype) |
| bool | RegisterUnit (Unit *unit) |
| bool | DeregisterUnit (Unit *unit) |
| Unit * | GetUnit (ushort_t remote_id) const |
| void | Update () |
Protected Member Functions | |
| virtual void | OnMessage (ActionEvent *pevent) |
| virtual void | OnMessage (InputEvent *pevent) |
| virtual bool | Serialize (Serializer &serializer) |
| virtual bool | Deserialize (Serializer &serializer, bool first) |
Protected Attributes | |
| string | name |
| Full player name. | |
| string | race_id |
| Race selected during game establishing. | |
| vector3 | color |
| Color selected during game establishing. | |
| Ref< Race > | race |
| Player's race. | |
| Ref< Root > | units |
| Root node of all units owned by player. | |
| UnitsMap | units_map |
| Hash map for translation remote identifiers of units. | |
| bool | active |
| Where player is active (= is myself). | |
| PlayerMap * | map |
| Local map of player that contains information like warfog etc. | |
Private Types | |
| typedef hash_map < ushort_t, Unit * > | UnitsMap |
Friends | |
| class | Level |
typedef hash_map<ushort_t, Unit *> Player::UnitsMap [private] |
| Player::Player | ( | const char * | id | ) |
Sets color to default red.
| Player::~Player | ( | ) | [virtual] |
Unloads resources and destroys player map.
| const string & Player::GetName | ( | ) | const [inline] |
| void Player::SetName | ( | const string & | name | ) | [inline] |
| const string & Player::GetRaceId | ( | ) | const [inline] |
| void Player::SetRaceId | ( | const string & | race_id | ) | [inline] |
| const vector3 & Player::GetColor | ( | ) | const [inline] |
| void Player::SetColor | ( | const vector3 & | color | ) | [inline] |
| void Player::SetActive | ( | bool | active | ) | [inline] |
| bool Player::IsActive | ( | ) | const [inline] |
| bool Player::IsHyper | ( | ) | const [inline] |
| bool Player::LoadResources | ( | ) |
| void Player::UnloadResources | ( | ) |
| void Player::CreatePlayerMap | ( | const MapSize & | map_size | ) |
| void Player::DeletePlayerMap | ( | ) |
| bool Player::UpdatePlayerMap | ( | const Unit * | unit, | |
| bool | added | |||
| ) |
| PlayerMap * Player::GetPlayerMap | ( | ) | const [inline] |
| Unit * Player::NewUnit | ( | const string & | prototype_id | ) |
| bool Player::RegisterUnit | ( | Unit * | unit | ) |
| bool Player::DeregisterUnit | ( | Unit * | unit | ) |
| void Player::Update | ( | ) |
| void Player::OnMessage | ( | ActionEvent * | pevent | ) | [protected, virtual] |
Reimplemented from MessageReceiver< ActionEvent >.
| void Player::OnMessage | ( | InputEvent * | pevent | ) | [protected, virtual] |
Reimplemented from MessageReceiver< InputEvent >.
| bool Player::Serialize | ( | Serializer & | serializer | ) | [protected, virtual] |
| bool Player::Deserialize | ( | Serializer & | serializer, | |
| bool | first | |||
| ) | [protected, virtual] |
Recursively deserialize all children.
Reimplemented from Root.
friend class Level [friend] |
string Player::name [protected] |
Full player name.
string Player::race_id [protected] |
Race selected during game establishing.
vector3 Player::color [protected] |
Color selected during game establishing.
Ref<Race> Player::race [protected] |
Player's race.
Ref<Root> Player::units [protected] |
Root node of all units owned by player.
UnitsMap Player::units_map [protected] |
Hash map for translation remote identifiers of units.
bool Player::active [protected] |
Where player is active (= is myself).
PlayerMap* Player::map [protected] |
Local map of player that contains information like warfog etc.
1.5.3