Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#ifndef ENTITY_H
#define ENTITY_H
/**
* The Entity class represents all playable and non-playable characters
*/
class Entity
{
protected:
const int maxHp;
int damage;
public:
/**
* Construct an entity
* @param[_maxHp] maximum amount of health possible
*/
Entity( int _maxHp );
/**
* Cause the entity to take damage
* @param[points] number of points damage to take
*/
void take_damage( int points );
/**
* Heal the entity
* @param[points] number of points of healing to do
*/
void heal( int points );
/**
* What is the current health of the entity
* @return current health in points
*/
int health() const;
/**
* Is the entity currently alive
* @return true is health() > 0 else false
*/
bool alive() const;
};
#endif