aboutsummaryrefslogtreecommitdiff
path: root/include/game.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-21 17:55:49 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-21 17:55:49 +0100
commit9401116d59066a2bb6de9c12d9642afee1069314 (patch)
treef886c23c9b4e2a300a1e2b1e18a068a2b39cd425 /include/game.hpp
parentcaeb26e90ef09fdad85af72f460644e09d3b2c7c (diff)
downloadmario_sokoban-9401116d59066a2bb6de9c12d9642afee1069314.tar.gz
mario_sokoban-9401116d59066a2bb6de9c12d9642afee1069314.tar.bz2
mario_sokoban-9401116d59066a2bb6de9c12d9642afee1069314.zip
Added history and some map from sokonlineHEADmaster
Diffstat (limited to 'include/game.hpp')
-rw-r--r--include/game.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/game.hpp b/include/game.hpp
index 946f07c..031f4fe 100644
--- a/include/game.hpp
+++ b/include/game.hpp
@@ -5,6 +5,7 @@
#include <fstream>
#include <string>
#include <vector>
+#include <stack>
#include <algorithm>
class Game
@@ -38,6 +39,8 @@ public:
bool won();
void move(Direction direction);
+ void undo();
+ void reset();
Cell get(int y, int x) const;
Cell get(Position pos) const;
size_t getHeight() const;
@@ -54,6 +57,7 @@ private:
Direction m_playerDirection;
std::vector<Position> m_cratePos;
std::vector<Position> m_payloadPos;
+ std::stack< std::pair<Position, std::vector<Position> > > m_history;
void construct(std::string fmt);
void findWidth(std::string fmt);