diff options
Diffstat (limited to 'frontend/Player.h')
-rw-r--r-- | frontend/Player.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/frontend/Player.h b/frontend/Player.h index 94ec6a3..09e3a73 100644 --- a/frontend/Player.h +++ b/frontend/Player.h @@ -1,8 +1,11 @@ #pragma once -#include <vector> #include <unordered_map> #include <string> +#include <memory> + +#include "backend/WeaponObject.h" +#include "backend/ArmorObject.h" class Dungeon; class Location; @@ -15,16 +18,15 @@ enum FollowupAction { }; class Player { - typedef std::vector<std::string> & Argv; - typedef FollowupAction Cmd(Argv); + typedef FollowupAction Cmd(std::string &); private: std::string name; unsigned int health_points = 20; float attack_chance = 0.4; unsigned int gold = 0; - // TODO: WeaponObject[] - // TODO: ArmorObject[] + std::unique_ptr<WeaponObject> weapon = nullptr; + std::unique_ptr<ArmorObject> armor = nullptr; Location & location; bool cheating = false; @@ -33,7 +35,7 @@ public: virtual ~Player() = default; public: - FollowupAction cmd(Argv argv); + FollowupAction cmd(std::string &); public: void take_damage(unsigned int dmg); @@ -44,7 +46,7 @@ private: void cmdset_death(); private: - std::unordered_map<std::string, FollowupAction(Player::*)(Argv)> cmds; + std::unordered_map<std::string, FollowupAction(Player::*)(std::string &)> cmds; Cmd cmd_query; Cmd cmd_search; Cmd cmd_go; |