aboutsummaryrefslogtreecommitdiff
path: root/frontend/Player.h
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/Player.h')
-rw-r--r--frontend/Player.h72
1 files changed, 0 insertions, 72 deletions
diff --git a/frontend/Player.h b/frontend/Player.h
deleted file mode 100644
index 249a129..0000000
--- a/frontend/Player.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#pragma once
-
-#include <unordered_map>
-#include <string>
-#include <memory>
-#include <vector>
-
-#include "backend/WeaponObject.h"
-#include "backend/ArmorObject.h"
-
-class Dungeon;
-class Location;
-
-enum FollowupAction {
- NONE,
- UPDATE,
- EXIT,
- RESTART,
-};
-
-class Player {
- typedef FollowupAction Cmd(std::string &);
-
-private:
- std::string name;
- unsigned int health_points = 20;
- float attack_chance = 0.4;
- unsigned int gold = 0;
- std::unique_ptr<WeaponObject> weapon = nullptr;
- std::unique_ptr<ArmorObject> armor = nullptr;
- Location & location;
- bool cheating = false;
- std::vector<std::unique_ptr<Object>> inventory = {};
-
-public:
- Player(Dungeon & dungeon);
- virtual ~Player() = default;
-
-public:
- FollowupAction cmd(std::string &);
-
-public:
- void take_damage(unsigned int dmg);
- float get_attack() const;
- unsigned get_health() const;
- Location & get_location() const;
-
-private:
- void cmdset_default();
- void cmdset_death();
-
-private:
- std::unordered_map<std::string, FollowupAction(Player::*)(std::string &)> 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;
-};
-