]> Shamusworld >> Repos - warehouse-man-deluxe/blobdiff - src/gameboard.h
Added/fixed editor, added play level functionality.
[warehouse-man-deluxe] / src / gameboard.h
index 4452e2595d2d0bd8476822a16dd38e70ad87c92c..6e65e2bded76d41fde572d5e152c1085487fceca 100644 (file)
@@ -1,13 +1,21 @@
 #ifndef __GAMEBOARD_H__
 #define __GAMEBOARD_H__
 
-enum { GTSpace=0x00, GTWall=0x01, GTBox=0x02, GTBoxSpot=0x04 };
+enum { GTSpace=0x00, GTWall=0x01, GTBox=0x02, GTBoxSpot=0x04, GTNull=0x08, GTMan=0x10 };
 enum { PMInvalid, PMWalk, PMPush };
 
+struct UndoMove
+{
+       int dx, dy, type;
+};
+
+class Level;
+
 class GameBoard
 {
        public:
                GameBoard(int);//, int, int, int);
+               GameBoard(Level *);
                ~GameBoard();
 
        protected:
@@ -23,19 +31,23 @@ 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
                int width, height;
                char * board;
+               const char * name;
 
        private:
                char * initialBoard;
                int initialX, initialY;
                int boardLength;
+               int numMoves;
+               UndoMove undo[8192];            // 8K moves ought to be enough for anybody
 };
 
 #endif // __GAMEBOARD_H__