diff options
author | Stijn Buys <ingar@osirion.org> | 2009-01-11 12:15:22 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-01-11 12:15:22 +0000 |
commit | 20e8e4c0fb1262a25c2491679da4587d264208a2 (patch) | |
tree | c836dc74bfb82088c70bdd636dfb1f236043f58d /src/core/player.h | |
parent | 7082a5a1b7258580c698a09cf9fb8bec0bc97472 (diff) |
core::Player interface updates
Diffstat (limited to 'src/core/player.h')
-rw-r--r-- | src/core/player.h | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/src/core/player.h b/src/core/player.h index f0c4996..4620062 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -46,11 +46,6 @@ public: /// the entity the Player is currently controling inline EntityControlable *control() const { return player_control; } - /// set the entity the player is currenty controlling - /** This will automaticly set zone() to the zone the entity is in - */ - void set_control(EntityControlable *entitycontrolable); - /// the zone the player is currently in inline Zone *zone() const { return player_zone; } @@ -85,6 +80,12 @@ public: /// returns true of the player has enough credits to pay amount inline bool has_credits(const long amount) const { return (player_credits >= amount); } + /// print player info to console + virtual void print() const; + + /// player level + const int level() const { return player_level; } + /*----- messages -------------------------------------------------- */ void send(const std::string name); @@ -125,26 +126,43 @@ public: /// update player info from client variables void update_info(); + /** + * @brief set the entity the player is currenty controlling + * This will automaticly set zone() to the zone the entity is in + */ + void set_control(EntityControlable *entitycontrolable); + + /// set mission target void set_mission_target(Entity *new_mission_target); + /// set the current view void set_view(Entity *view); - void set_credits(long amount); + /// set the amount of credits the players has + void set_credits(const long amount); - void add_credits(long amount); + /** + * @brief add an amount to the player's credits + * @param amount the amount of credits to add, can be negative + */ + void add_credits(const long amount); - void set_ping(long ping); + /** + * @brief set the player's network ping + */ + void set_ping(const long ping); - inline void set_dirty() { player_dirty = true; } + /// set the player level + void set_level(const int level); -/* -- should actually not be public --*/ + /// set the dirty bit + inline void set_dirty(const bool dirty = true) { player_dirty = dirty; } - /// dirty state - bool player_dirty; + /// set the zonechange bit + inline void set_zonechange(const bool dirty = true) { player_zonechange = dirty; } - /// player has changed zone - bool player_zonechange; +/* -- should actually not be public --*/ /// id of the player int player_id; @@ -164,12 +182,13 @@ public: std::list<EntityControlable *> assets; private: - // the entity the Player is currently controling + // entity the Player is currently controling EntityControlable *player_control; - // the entity the PLayer is currently looking at + // entity the Player is currently looking at Entity *player_view; + // current mission target Entity *player_mission_target; // the zone the player is currently in @@ -178,7 +197,13 @@ private: long player_credits; long player_ping; std::string player_rconpassword; - + int player_level; + + // dirty bit + bool player_dirty; + // bit to indicate zone has changed + bool player_zonechange; + }; } |