treewars/player.h

33 lines
642 B
C++

/* Holds some useful data about each player
*/
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <string>
using std::string;
class Player
{
public:
Player(string name = "player", unsigned int colour = 0x000000);
unsigned int get_energy() const { return energy; }
unsigned int get_colour() const { return colour; }
string get_name() const { return name; }
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;
string name;
};
#endif