[RULE CHANGE] "NO_MOVE" is no longer a legal
[progcomp2012.git] / judge / manager / stratego.cpp
index 5acfaa3..e142a4b 100644 (file)
@@ -57,6 +57,27 @@ Piece::Type Piece::GetType(char fromToken)
        return Piece::BOULDER;
 }
 
+/**
+ * Gets the opposite to the indicated colour
+ */
+Piece::Colour Piece::OppositeColour(const Colour & colour)
+{
+       switch (colour)
+       {
+               case Piece::RED:
+                       return Piece::BLUE;
+                       break;
+               case Piece::BLUE:
+                       return Piece::RED;
+                       break;
+               case Piece::BOTH:
+                       return Piece::BOTH;
+                       break;
+               case Piece::NONE:
+                       return Piece::NONE;
+       }
+}
+
 /**
  * Construct a new, empty board
  * @param newWidth - the width of the board

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