diff options
Diffstat (limited to 'backend/Player.h')
| -rw-r--r-- | backend/Player.h | 40 | 
1 files changed, 40 insertions, 0 deletions
| diff --git a/backend/Player.h b/backend/Player.h new file mode 100644 index 0000000..b101de2 --- /dev/null +++ b/backend/Player.h @@ -0,0 +1,40 @@ +#pragma once + +#include "WeaponObject.h" +#include "ArmorObject.h" +#include "PtrList.h" + +class Dungeon; +class Location; + +class Player { +public: +	String name; +	unsigned int health_points = 20; +	float attack_chance = 0.4; +	unsigned int gold = 0; +	WeaponObject * weapon = nullptr; +	ArmorObject * armor = nullptr; +	bool cheating = false; +	PtrList<Object> inventory; + +private: +	Location * location = nullptr; + +public: +	Player(Dungeon & dungeon); +	virtual ~Player() = default; + +public: +	void take_damage(unsigned int dmg); +	float get_attack() const; +	unsigned get_health() const; +	Location & get_location() const; +	void set_location(Location &); +	void equip(WeaponObject *); +	void equip(ArmorObject *); + +private: +	Dungeon & dungeon; +}; + |