2 * Contains declaration for MovementResult class
11 * Class used to indicate the result of a move in stratego
16 typedef enum {OK, DIES, KILLS, BOTH_DIE, NO_BOARD, INVALID_POSITION, NO_SELECTION, NOT_YOUR_UNIT, IMMOBILE_UNIT, INVALID_DIRECTION, POSITION_FULL, VICTORY_FLAG, VICTORY_ATTRITION, SURRENDER, BAD_RESPONSE, NO_MOVE, COLOUR_ERROR, ERROR, DRAW_DEFAULT, DRAW, BAD_SETUP} Type;
18 MovementResult(const Type & result = OK, const Piece::Type & newAttackerRank = Piece::NOTHING, const Piece::Type & newDefenderRank = Piece::NOTHING)
19 : type(result), attackerRank(newAttackerRank), defenderRank(newDefenderRank) {}
20 MovementResult(const MovementResult & cpy) : type(cpy.type), attackerRank(cpy.attackerRank), defenderRank(cpy.defenderRank) {}
21 virtual ~MovementResult() {}
24 bool operator==(const Type & equType) const {return type == equType;}
25 bool operator!=(const Type & equType) const {return type != equType;}
28 Piece::Type attackerRank;
29 Piece::Type defenderRank;