00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __GameControlData_h_
00010 #define __GameControlData_h_
00011
00012 typedef long unsigned int uint32;
00013
00014 #include "RoboCupGameControlData.h"
00015 #include "Tools/Streams/InOut.h"
00016 #include "Tools/Player.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025 class GameControlData
00026 {
00027 public:
00028 enum State
00029 {
00030 initial = STATE_INITIAL,
00031 ready = STATE_READY,
00032 set = STATE_SET,
00033 playing = STATE_PLAYING,
00034 finished = STATE_FINISHED
00035 };
00036
00037 enum Penalties
00038 {
00039 notPenalized = PENALTY_NONE,
00040 illegalDefender = PENALTY_ILLEGAL_DEFENDER,
00041 illegalDefense = PENALTY_ILLEGAL_DEFENSE,
00042 obstruction = PENALTY_OBSTRUCTION,
00043 goaliePushing = PENALTY_GOALIE_PUSHING,
00044 playerPushing = PENALTY_PLAYER_PUSHING,
00045 ballHolding = PENALTY_BALL_HOLDING,
00046 requestForPickup = PENALTY_REQ_FOR_PICKUP,
00047 leaving = PENALTY_LEAVING,
00048 damage = PENALTY_DAMAGE,
00049 numOfPenalties
00050 };
00051
00052 enum KickoffTeam
00053 {
00054 undefinedTeam,
00055 ownTeam,
00056 opponentTeam
00057 };
00058
00059
00060
00061
00062 GameControlData();
00063
00064
00065 static const char* getStateName(State state);
00066
00067
00068 static const char* getKickoffTeamName(KickoffTeam kickoffTeam);
00069
00070
00071 static const char* getPenaltyName(Penalties penalty);
00072
00073
00074 Penalties getPenalty(Player player = getPlayer()) const;
00075
00076
00077 unsigned int getOwnTeamNumber(Player player = getPlayer()) const;
00078
00079
00080 const TeamInfo& getOwnTeam(Player player = getPlayer()) const;
00081 TeamInfo& getOwnTeam(Player player = getPlayer());
00082
00083
00084 unsigned int getOpponentTeamNumber(Player player = getPlayer()) const;
00085
00086
00087 const RobotInfo& getRobot(Player player = getPlayer()) const;
00088 RobotInfo& getRobot(Player player = getPlayer());
00089
00090
00091 const TeamInfo& getOpponentTeam(Player player = getPlayer()) const;
00092 TeamInfo& getOpponentTeam(Player Player = getPlayer());
00093
00094
00095 KickoffTeam getKickoffTeam(Player player = getPlayer()) const;
00096
00097
00098 const TeamInfo& getTeamByNumber(int number) const;
00099 TeamInfo& getTeamByNumber(int number);
00100
00101 const TeamInfo& getTeamByColor(int color) const;
00102 TeamInfo& getTeamByColor(int color);
00103
00104
00105 bool operator == (const GameControlData& other);
00106
00107
00108 bool operator != (const GameControlData& other)
00109 {
00110 return ! (*this == other);
00111 }
00112
00113
00114
00115
00116 mutable RoboCupGameControlData data;
00117
00118 mutable bool switchOff;
00119
00120
00121
00122
00123
00124 unsigned long timeStamp;
00125 };
00126
00127
00128
00129
00130
00131
00132
00133
00134 In& operator>>(In& stream,GameControlData& gameControlData);
00135
00136
00137
00138
00139
00140
00141
00142 Out& operator<<(Out& stream, const GameControlData& gameControlData);
00143
00144 #endif //__GameControlData_h_
00145