diff options
Diffstat (limited to 'src/core/player.h')
-rw-r--r-- | src/core/player.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/src/core/player.h b/src/core/player.h index fd4053c..db6860a 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -7,6 +7,8 @@ #ifndef __INCLUDED_CORE_PLAYER_H__ #define __INCLUDED_CORE_PLAYER_H__ +#include "math/mathlib.h" + namespace core { class Player; @@ -26,26 +28,24 @@ public: Player(); ~Player(); - /// clear all the data - void clear(); - - /// name of the player - inline std::string const &name() const { return player_name; } +/*----- inspectors ------------------------------------------------ */ /// id of the player inline int id() const { return player_id; } + + /// name of the player + inline std::string const &name() const { return player_name; } /// dirty flag inline bool dirty() const { return player_dirty; } - /// id of the player - int player_id; + /// the entity the Player is currently controling + inline EntityControlable *control() const { return player_control; } - /// name of the player - std::string player_name; + /// player base color + inline math::Color const & color() const { return player_color; } - /// the entity the Player is currently controling - EntityControlable *control; +/*----- mutators -------------------------------------------------- */ /// serialize player info to a stream void serialize_server_update(std::ostream & os) const; @@ -53,8 +53,31 @@ public: /// receive player info from a stream void recieve_server_update(std::istream &is); - /// dirty state + /// serialize player info to a stream + void serialize_client_update(std::ostream & os) const; + + /// receive player info from a stream + void recieve_client_update(std::istream &is); + + /// clear all the data + void clear(); + +/* -- should actually not be public --*/ + + // dirty state bool player_dirty; + + // id of the player + int player_id; + + // name of the player + std::string player_name; + + // color + math::Color player_color; + + // the entity the Player is currently controling + EntityControlable *player_control; }; } |