#include <assert.h>
-#ifdef GRAPHICS
+
#include "graphics.h"
#include "array.h"
-#endif //GRAPHICS
+
/**
* Contains classes for a game of Stratego
const Type type;
const Colour colour;
- #ifdef GRAPHICS
public:
class TextureManager : public Graphics::TextureManager<LUint>, private Array<Texture*>
- #endif //GRAPHICS
+
};
+#include "movementresult.h"
+
/**
* A Stratego board
*/
virtual ~Board(); //Destructor
void Print(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board
- #ifdef GRAPHICS
- void Draw(const Piece::Colour & reveal=Piece::BOTH); //Draw board
- #endif //GRAPHICS
+ void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board using colour
+
+ void Draw(const Piece::Colour & reveal=Piece::BOTH); //Draw board
+
bool AddPiece(int x, int y, const Piece::Type & newType, const Piece::Colour & newColour); //Add piece to board
typedef enum {UP, DOWN, LEFT, RIGHT} Direction;
- typedef enum {OK, DIES, KILLS, BOTH_DIE, NO_BOARD, INVALID_POSITION, NO_SELECTION, NOT_YOUR_UNIT, IMMOBILE_UNIT, INVALID_DIRECTION, POSITION_FULL, VICTORY, BAD_RESPONSE, NO_MOVE} MovementResult; //The possible results from a move
- //WARNING: Some of the MovementResults are returned by the Controller class in "controller.h", in Controller::MakeMove
+
static bool LegalResult(const MovementResult & result)
{
- return (result == OK || result == DIES || result == KILLS || result == BOTH_DIE);
+ return (result == MovementResult::OK || result == MovementResult::DIES || result == MovementResult::KILLS || result == MovementResult::BOTH_DIE || result == MovementResult::VICTORY || result == MovementResult::DRAW);
}
MovementResult MovePiece(int x, int y, const Direction & direction, int multiplier=1,const Piece::Colour & colour=Piece::NONE); //Move piece from position in direction
- static Board theBoard;
+
Piece::Colour winner;