[RULE CHANGE] *Victory by "attrition"* + Bug fixes
[progcomp2012.git] / judge / manager / stratego.h
index fe73aa1..d2e667f 100644 (file)
@@ -6,9 +6,8 @@
 
 #include <assert.h>
 
-
-       #include "graphics.h"
-       #include "array.h"
+#include "graphics.h"
+#include "array.h"
 
 #include <vector>
 
@@ -58,6 +57,7 @@ class Piece
 
                public:
 
+                       #ifdef BUILD_GRAPHICS
                        class TextureManager : public Graphics::TextureManager<LUint>, private Array<Texture*>
                        {
                                public:
@@ -86,7 +86,7 @@ class Piece
                                                break;
                                }
                        }
-
+                       #endif //BUILD_GRAPHICS
                        
                        
 
@@ -108,8 +108,9 @@ class Board
                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
                
+               #ifdef BUILD_GRAPHICS
                void Draw(const Piece::Colour & reveal=Piece::BOTH, bool showRevealed = true); //Draw board
-               
+               #endif //BUILD_GRAPHICS
 
                bool AddPiece(int x, int y, const Piece::Type & newType, const Piece::Colour & newColour); //Add piece to board
 
@@ -123,12 +124,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

UCC git Repository :: git.ucc.asn.au