X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=manager%2Fstratego.h;h=39e887310d6e43f23f858eb3f4f580afd601166f;hb=fe470c015d73d07c44f0e951a2bb205d95763f22;hp=25aa5cca35864a9643a4aaf85e3aa9ec986a813c;hpb=2ab27eb698cfd57977cc9cc25edcbfbeb3b1b1ee;p=progcomp2012.git diff --git a/manager/stratego.h b/manager/stratego.h index 25aa5cc..39e8873 100644 --- a/manager/stratego.h +++ b/manager/stratego.h @@ -6,10 +6,10 @@ #include -#ifdef GRAPHICS + #include "graphics.h" #include "array.h" -#endif //GRAPHICS + /** * Contains classes for a game of Stratego @@ -51,7 +51,6 @@ class Piece const Type type; const Colour colour; - #ifdef GRAPHICS public: class TextureManager : public Graphics::TextureManager, private Array @@ -85,7 +84,7 @@ class Piece - #endif //GRAPHICS + }; @@ -102,9 +101,10 @@ class 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 @@ -118,11 +118,11 @@ class Board static bool LegalResult(const MovementResult & result) { - return (result == MovementResult::OK || result == MovementResult::DIES || result == MovementResult::KILLS || result == MovementResult::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;