Fixed bugs, minor changes
[progcomp2012.git] / progcomp / judge / manager / movementresult.h
1 /**
2  * Contains declaration for MovementResult class
3  */
4 #ifndef MOVERESULT_H
5 #define MOVERESULT_H
6
7 class Board;
8 class Piece;
9
10 /**
11  * Class used to indicate the result of a move in stratego
12  */
13 class MovementResult
14 {
15         public:
16                 typedef enum {OK, DIES, KILLS, BOTH_DIE, NO_BOARD, INVALID_POSITION, NO_SELECTION, NOT_YOUR_UNIT, IMMOBILE_UNIT, INVALID_DIRECTION, POSITION_FULL, VICTORY, SURRENDER, BAD_RESPONSE, NO_MOVE, COLOUR_ERROR, ERROR, DRAW_DEFAULT, DRAW, BAD_SETUP} Type;
17
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() {}
22                 
23
24                 bool operator==(const Type & equType) const {return type == equType;}
25                 bool operator!=(const Type & equType) const {return type != equType;}
26
27                 Type type;
28                 Piece::Type attackerRank;
29                 Piece::Type defenderRank;
30 };
31
32 #endif //MOVERESULT_H
33
34 //EOF

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