treewars/player.cpp

29 lines
361 B
C++
Raw Normal View History

#include "player.h"
Player::Player(unsigned int colour)
{
this->colour = colour;
energy = 50;
}
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;
}