#pragma once #include #include #include class Dungeon; class Location; enum FollowupAction { NONE, UPDATE, EXIT, RESTART, }; class Player { typedef std::vector & Argv; typedef FollowupAction Cmd(Argv); private: std::string name; unsigned int health_points = 20; float attack_chance = 0.4; unsigned int gold = 0; // TODO: WeaponObject[] // TODO: ArmorObject[] Location & location; bool cheating = false; public: Player(Dungeon & dungeon); virtual ~Player() = default; public: FollowupAction cmd(Argv argv); public: void take_damage(unsigned int dmg); float get_attack(); private: void cmdset_default(); void cmdset_death(); private: std::unordered_map cmds; Cmd cmd_query; Cmd cmd_search; Cmd cmd_go; Cmd cmd_get; Cmd cmd_put; Cmd cmd_view; Cmd cmd_hit; Cmd cmd_equip; Cmd cmd_wait; Cmd cmd_use; Cmd cmd_help; Cmd cmd_cheat; Cmd cmd_quit; Cmd cmd_restart; private: Dungeon & dungeon; };