X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=manager%2Fstratego.h;h=25aa5cca35864a9643a4aaf85e3aa9ec986a813c;hp=877af2d19ad7df952a6367ea6741a6088d746a2a;hb=53a666903d770b14969f542d6548e267e5017b31;hpb=f91a915d6f64f9d35e867d26e8ddb9c1b1ab0c1e diff --git a/manager/stratego.h b/manager/stratego.h index 877af2d..25aa5cc 100644 --- a/manager/stratego.h +++ b/manager/stratego.h @@ -89,6 +89,8 @@ class Piece }; +#include "movementresult.h" + /** * A Stratego board */ @@ -112,12 +114,11 @@ class 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); } MovementResult MovePiece(int x, int y, const Direction & direction, int multiplier=1,const Piece::Colour & colour=Piece::NONE); //Move piece from position in direction