DamageableObject class

Derived classes

class Box final
class Pig
class Player final

Constructors, destructors, conversion operators

DamageableObject(const int hp, const int invulnerab_time, const int dying_time)

Public functions

void update() virtual
void heal(const int n) virtual
void damage(const int n) virtual
auto getHp() const -> int virtual
auto getMaxHp() const -> int virtual
auto isDying() const -> bool virtual
auto isDead() const -> bool virtual
auto isInvulnerable() const -> bool virtual

Protected functions

void startInvulnerable() virtual
void stopInvulnerable() virtual

Protected variables

int hp_
int max_hp_
int dying_time_
int invulnerable_time_
Timer invulnerable_timer_
Timer dying_timer_
bool is_dead_
bool is_dying_
bool is_invulnerable_