aboutsummaryrefslogtreecommitdiff
path: root/frontend/Player.h
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/Player.h')
-rw-r--r--frontend/Player.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/frontend/Player.h b/frontend/Player.h
index a99736d..c5fbb1e 100644
--- a/frontend/Player.h
+++ b/frontend/Player.h
@@ -1,9 +1,55 @@
#pragma once
+#include <vector>
+#include <unordered_map>
+#include <string>
+
+class Dungeon;
+
+enum FollowupAction {
+ NONE,
+ UPDATE,
+ EXIT,
+ RESTART,
+};
+
class Player {
+ typedef std::vector<std::string> & Argv;
+ typedef FollowupAction Cmd(Argv);
+
private:
unsigned int health_points = 0;
unsigned int attack_chance = 0;
+public:
+ Player(Dungeon & dungeon);
+ virtual ~Player() = default;
+
+public:
+ FollowupAction cmd(Argv argv);
+
+private:
+ void cmdset_default();
+ void cmdset_death();
+
+private:
+ std::unordered_map<std::string, FollowupAction(Player::*)(Argv)> 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;
};