]> Shamusworld >> Repos - warehouse-man-deluxe/blobdiff - src/gameboard.h
Added undo move system, various improvements.
[warehouse-man-deluxe] / src / gameboard.h
index 4452e2595d2d0bd8476822a16dd38e70ad87c92c..9f59480e961c7a42a632552f4aee66b01fbd1813 100644 (file)
@@ -4,6 +4,11 @@
 enum { GTSpace=0x00, GTWall=0x01, GTBox=0x02, GTBoxSpot=0x04 };
 enum { PMInvalid, PMWalk, PMPush };
 
+struct UndoMove
+{
+       int dx, dy, type;
+};
+
 class GameBoard
 {
        public:
@@ -23,9 +28,10 @@ class GameBoard
                bool IsBoxSOfPlayer(void);
                bool IsBoxEOfPlayer(void);
                bool IsBoxWOfPlayer(void);
+               bool UndoLastMove(int &, int &, int &);
 
        private:
-               int Move(int & var, int direction, char, char);
+               int Move(int dx, int dy, char, char);
 
        public:
                int playerX, playerY;           // Player X/Y are zero-based
@@ -36,6 +42,8 @@ class GameBoard
                char * initialBoard;
                int initialX, initialY;
                int boardLength;
+               int numMoves;
+               UndoMove undo[8192];            // 8K moves ought to be enough for anybody
 };
 
 #endif // __GAMEBOARD_H__