#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 inventory; private: Location * location = nullptr; public: Player(Dungeon & dungeon); virtual ~Player(); Player(const Player &) = delete; Player(Player &&) = delete; Player & operator = (const Player &) = delete; Player & operator = (Player &&) = delete; public: void take_damage(unsigned int dmg); void add_health(unsigned int bonus); float get_attack() const; void add_attack(float bonus); unsigned get_health() const; Location & get_location() const; void set_location(Location &); void equip(WeaponObject *) noexcept; void equip(ArmorObject *) noexcept; void equip(Object *); bool is_dead() const; private: Dungeon & dungeon; };