X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fstratego.h;h=f439e808f62885f32c6fd379a5c1b329c4ac6d32;hp=c8f4f9d76a6b58643c4a0ecf96f74888ab566363;hb=5f9adddd695f2664a0d690b59a779e40b51ade3d;hpb=78293905481ab7a67e773d05350da29940a58ea6 diff --git a/judge/manager/stratego.h b/judge/manager/stratego.h index c8f4f9d..f439e80 100644 --- a/judge/manager/stratego.h +++ b/judge/manager/stratego.h @@ -28,6 +28,9 @@ class Piece typedef enum {RED=0, BLUE=1, NONE=2, BOTH=3} Colour; //Used for the allegiance of the pieces - terrain counts as NONE. + static Colour OppositeColour(const Colour & compare); + + Piece(const Type & newType, const Colour & newColour) : type(newType), colour(newColour), beenRevealed(false) {} virtual ~Piece() {} @@ -106,7 +109,7 @@ class Board virtual ~Board(); //Destructor void Print(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board - void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board using colour + void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH, bool showRevealed=true); //Print board using colour #ifdef BUILD_GRAPHICS void Draw(const Piece::Colour & reveal=Piece::BOTH, bool showRevealed = true); //Draw board @@ -124,12 +127,12 @@ class Board static bool LegalResult(const MovementResult & result) { - return (result == MovementResult::OK || result == MovementResult::DIES || result == MovementResult::KILLS || result == MovementResult::BOTH_DIE || result == MovementResult::VICTORY || result == MovementResult::DRAW || result == MovementResult::DRAW_DEFAULT || result == MovementResult::SURRENDER); + return (result == MovementResult::OK || result == MovementResult::DIES || result == MovementResult::KILLS || result == MovementResult::BOTH_DIE || result == MovementResult::VICTORY_FLAG || result == MovementResult::VICTORY_ATTRITION || result == MovementResult::DRAW || result == MovementResult::DRAW_DEFAULT || result == MovementResult::SURRENDER); } static bool HaltResult(const MovementResult & result) { - return (result == MovementResult::VICTORY || result == MovementResult::DRAW || result == MovementResult::DRAW_DEFAULT || result == MovementResult::SURRENDER || !LegalResult(result)); + return (result == MovementResult::VICTORY_FLAG || result == MovementResult::VICTORY_ATTRITION || result == MovementResult::DRAW || result == MovementResult::DRAW_DEFAULT || result == MovementResult::SURRENDER || !LegalResult(result)); } MovementResult MovePiece(int x, int y, const Direction & direction, int multiplier=1,const Piece::Colour & colour=Piece::NONE); //Move piece from position in direction