summaryrefslogtreecommitdiff
path: root/graphs/cpp/hot_potato/player.hh
diff options
context:
space:
mode:
Diffstat (limited to 'graphs/cpp/hot_potato/player.hh')
-rw-r--r--graphs/cpp/hot_potato/player.hh25
1 files changed, 25 insertions, 0 deletions
diff --git a/graphs/cpp/hot_potato/player.hh b/graphs/cpp/hot_potato/player.hh
new file mode 100644
index 0000000..0439305
--- /dev/null
+++ b/graphs/cpp/hot_potato/player.hh
@@ -0,0 +1,25 @@
+#pragma once
+#include <memory>
+#include <string>
+
+#include "bomb.hh"
+
+class Player
+{
+public:
+ Player(const std::string& name, size_t nb_presses);
+ Player* get_next() const;
+ void set_next(std::unique_ptr<Player> next);
+ void pass_bomb(Player& receiver);
+ void press_bomb();
+ void set_bomb(std::unique_ptr<Bomb> bomb);
+ const std::string& get_name() const;
+ bool has_bomb() const;
+ bool is_dead() const;
+
+private:
+ std::string name_;
+ std::unique_ptr<Bomb> bomb_;
+ size_t nb_presses_;
+ std::unique_ptr<Player> next_;
+}; \ No newline at end of file