Skip to content
Snippets Groups Projects
Commit 906d07aa authored by Ian Prins's avatar Ian Prins
Browse files

add constructor, inhereit publically

parent 39222d86
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,9 @@
#ifndef PLAYERCHAR_H
#define PLAYERCHAR_H
class PlayerChar : Mob {
class PlayerChar : public Mob {
public:
PlayerChar(Coord);
int getStrength();
int getArmor();
int getGold();
......@@ -17,13 +18,9 @@ class PlayerChar : Mob {
bool foundAmulet();
int maxDelved();
private:
int HP;
int maxHP;
int armor;
int strength;
int gold;
const int START_HP=10, START_ARMOR=0, START_STR=1, START_GOLD=0, START_LEVEL=1;
int HP, maxHP, armor, strength, gold, level;
ItemZone backpack;
int level;
bool hasFoundAmulet;
int maxDepth;
};
......
......@@ -3,6 +3,19 @@
#include "include/playerchar.h"
#include "include/coord.h"
PlayerChar::PlayerChar(Coord pos)
: Mob("@Rogue", pos)
, HP(START_HP)
, maxHP(START_HP)
, armor(START_ARMOR)
, strength(START_STR)
, gold(START_GOLD)
, level(START_LEVEL)
, backpack(ItemZone())
, hasFoundAmulet(false)
, maxDepth(1)
{}
int PlayerChar::getHP() {
return HP;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment