CPP-RPG/Enemy.cpp

46 lines
597 B
C++
Raw Normal View History

2021-01-24 14:40:11 -05:00
#include "Enemy.h"
Enemy::Enemy()
2021-01-25 21:40:08 -05:00
: name("Mr. No-name!"),
hitPoints(1),
gold(1),
weapon(Weapon())
2021-01-24 14:40:11 -05:00
{
}
2021-01-25 21:40:08 -05:00
Enemy::Enemy(std::string setName,
int setHitPoints,
int setGold,
const Weapon &setWeapon)
: name(setName),
hitPoints(setHitPoints),
gold(setGold),
weapon(setWeapon)
{
}
bool Enemy::Alive() const
{
return (hitPoints > 0);
}
std::string Enemy::getName() const
{
return name;
}
int Enemy::getHitPoints() const
{
return hitPoints;
}
int Enemy::getGold() const
{
return gold;
}
Weapon Enemy::getWeapon() const
{
return weapon;
}