2011-07-01 18:10:45 +00:00
|
|
|
/* Holds some useful data about each player
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PLAYER_H_
|
|
|
|
#define _PLAYER_H_
|
|
|
|
|
2011-07-02 00:00:19 +00:00
|
|
|
#include <string>
|
|
|
|
using std::string;
|
|
|
|
|
2011-07-01 18:10:45 +00:00
|
|
|
class Player
|
|
|
|
{
|
|
|
|
public:
|
2011-07-02 00:00:19 +00:00
|
|
|
Player(string name = "player", unsigned int colour = 0x000000);
|
2011-07-01 18:10:45 +00:00
|
|
|
|
|
|
|
unsigned int get_energy() const { return energy; }
|
|
|
|
unsigned int get_colour() const { return colour; }
|
2011-07-02 00:00:19 +00:00
|
|
|
string get_name() const { return name; }
|
2011-07-01 18:10:45 +00:00
|
|
|
|
|
|
|
void add_energy(unsigned int amount);
|
|
|
|
bool spend_energy(unsigned int amount);
|
|
|
|
|
|
|
|
bool has_played() const { return played; }
|
|
|
|
void set_played();
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int energy;
|
|
|
|
unsigned int colour;
|
|
|
|
bool played;
|
2011-07-02 00:00:19 +00:00
|
|
|
string name;
|
2011-07-01 18:10:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|