46 lines
597 B
C++
46 lines
597 B
C++
#include "Enemy.h"
|
|
|
|
Enemy::Enemy()
|
|
: name("Mr. No-name!"),
|
|
hitPoints(1),
|
|
gold(1),
|
|
weapon(Weapon())
|
|
{
|
|
}
|
|
|
|
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;
|
|
}
|