30 lines
397 B
C++
30 lines
397 B
C++
#include "player.h"
|
|
|
|
Player::Player(string name, unsigned int colour)
|
|
{
|
|
this->name = name;
|
|
this->colour = colour;
|
|
energy = 25;
|
|
}
|
|
|
|
|
|
void Player::add_energy(unsigned int amount)
|
|
{
|
|
energy += amount;
|
|
}
|
|
|
|
|
|
bool Player::spend_energy(unsigned int amount)
|
|
{
|
|
if (amount > energy) return false;
|
|
|
|
energy -= amount;
|
|
return true;
|
|
}
|
|
|
|
|
|
void Player::set_played()
|
|
{
|
|
played = true;
|
|
}
|