diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-21 17:55:49 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-21 17:55:49 +0100 |
| commit | 9401116d59066a2bb6de9c12d9642afee1069314 (patch) | |
| tree | f886c23c9b4e2a300a1e2b1e18a068a2b39cd425 /include/game.hpp | |
| parent | caeb26e90ef09fdad85af72f460644e09d3b2c7c (diff) | |
| download | mario_sokoban-master.tar.gz mario_sokoban-master.tar.bz2 mario_sokoban-master.zip | |
Diffstat (limited to 'include/game.hpp')
| -rw-r--r-- | include/game.hpp | 4 |
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); |
