You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
719 B
C++

#ifndef HERO_H
#define HERO_H
enum class Direction
{
LEFT,
UP,
RIGHT,
DOWN,
NONE
};
/// Represents a controlable by player game character
class Hero
{
private:
int hero_charges;
int pos_x, pos_y;
public:
explicit Hero(int position_x = 0, int position_y = 0, int initial_charges = 0);
/// Add more charges for hero to use
void refillCharges(int append_charges);
/// Get amount of charges
int charges() const noexcept;
/// Spend one charge on action
bool useCharge();
/// Get current Hero position
void position(int &x, int &y) const noexcept;
/// Move hero by one cell to any direction
void move(Direction &direction);
};
#endif // HERO_H