enum { GTSpace=0x00, GTWall=0x01, GTBox=0x02, GTBoxSpot=0x04 };
enum { PMInvalid, PMWalk, PMPush };
+struct UndoMove
+{
+ int dx, dy, type;
+};
+
class GameBoard
{
public:
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
char * initialBoard;
int initialX, initialY;
int boardLength;
+ int numMoves;
+ UndoMove undo[8192]; // 8K moves ought to be enough for anybody
};
#endif // __GAMEBOARD_H__