|
|
This class is the base of all cobra server states. Here, the default actions, that will be done by every state (unless it defines something else) are determined. States, that want to extend and not to entirely replace the action of this base class, should simply call the corresponding method in this class before executinh their own stuff.
cobra_ServerBasicState (ServerCoordinator* i, cobra_InternalServerSpecificRepository* cobra_issp, cobra_SharedServerSpecificRepository* cobra_sharedssp)
throw (StrategyException,bad_exception) | cobra_ServerBasicState |
~cobra_ServerBasicState ()
throw() | ~cobra_ServerBasicState |
[virtual]
void sendServerTips ()
throw (StrategyException,bad_exception) | sendServerTips |
[virtual]
This method is called from the coordinator's processReceivedRTBMessages method and should send tips to the clients.
Reimplemented from ServerState.
void reset ()
throw (bad_exception, StrategyException) | reset |
[virtual]
This method is called by ClientCoordinatorRevokes::resetGame()
Reimplemented from State.
void receiveRTBMessageRadar (double dist,object_type type,double angle)
throw (StrategyException, bad_exception) | receiveRTBMessageRadar |
[virtual]
This method is called when the RTB message "Radar [dist] [type] [angle]" occurs. This message occurs each turn and gives information about the closest object in the direction the radar points to.
Parameters:
dist | The distance of the observed object |
type | The type of the observed object |
angle | The angle the observed object is seen at in rad, relative to the robot front |
Reimplemented from State.
void receiveRTBMessageInfo (double time,double speed,double cannonAngle)
throw (StrategyException, bad_exception) | receiveRTBMessageInfo |
[virtual]
This method is called when the RTB message "Info [time] [speed] [cannonAngle]" occurs. This message is sent each turn and gives information about the robot itself.
Parameters:
time | The time that has elapsed since the game had started |
speed | The velocity of the robot |
cannonAngle | The angle the cannon points to |
Reimplemented from State.
void receiveRTBMessageCoordinates (double x,double y,double angle)
throw (StrategyException, bad_exception) | receiveRTBMessageCoordinates |
[virtual]
This method is called when the RTB message "Coordinates [x] [y] [angle]" occurs. Generally, this message is sent each turn. If the game option SEND_ROBOT_COORDINATES is sent to 2, absolute coordinates are sent. If this value is 1, the coordinates are given relative to the starting point. On the case 0, this message is not sent.
Parameters:
x | And ... |
y | ... are the sent coordinates |
angle | is the angle the robot front points to |
Reimplemented from State.
void receiveRTBMessageRobotInfo (double energy,bool isTeamMate)
throw (StrategyException, bad_exception) | receiveRTBMessageRobotInfo |
[virtual]
This method is called when the RTB message "RobotInfo [energy] [isTeamMate]" occurs. This message is always sent after another robot has been detected by the radar. It gives some information about this might-be foe.
Parameters:
energy | The unexact energy level of the detected robot |
isTeamMate | Defines whether the robot is a team mate (team mode is not yet implemented in RTB) |
Reimplemented from State.
void receiveRTBMessageRotationReached (int what)
throw (StrategyException, bad_exception) | receiveRTBMessageRotationReached |
[virtual]
This method is called when the RTB message "RotationReached [what]" occurs. In our case, this message is sent, when a rotation initiated by "RotateTo" or "RotateAmount" has finished or the sweeping has changed direction.
Parameters:
what | What this message bears on; 1 = Robot, 2 = Cannon, 4 = Radar |
Reimplemented from State.
void receiveRTBMessageEnergy (double energy)
throw (StrategyException, bad_exception) | receiveRTBMessageEnergy |
[virtual]
This method is called when the RTB message "Energy [energy]" occurs. This message is sent at the end of each turn and specifies the health state of the robot.
Parameters:
energy | The unexact energy level |
Reimplemented from State.
void receiveRTBMessageRobotsLeft (int num)
throw (StrategyException, bad_exception) | receiveRTBMessageRobotsLeft |
[virtual]
This method is called when the RTB message "RobotsLeft [num]" occurs. This message is sent at the beginning of the game and after a robot has been killed.
Parameters:
num | The number of remaining robots |
Reimplemented from State.
void receiveRTBMessageCollision (object_type type,double angle)
throw (StrategyException, bad_exception) | receiveRTBMessageCollision |
[virtual]
This method is called when the RTB message "Collision [type] [angle]" occurs. This message is sent whan the robot has been hit by or hits another object,
Parameters:
type | The type of the hit object |
angle | The angle the collision happened at in rad, relative to the robot front |
Reimplemented from State.
void receiveRTBMessageWarning (warning_type warning,const string& message)
throw (StrategyException, bad_exception) | receiveRTBMessageWarning |
[virtual]
This method is called when the RTB message "Warning [warning] [message]" occurs. This message when RTB has notify the robot on a problem
Parameters:
warning | The type of the warning |
message | The text of the warning |
Reimplemented from State.
void receiveRTBMessageDead ()
throw (StrategyException, bad_exception) | receiveRTBMessageDead |
[virtual]
This method is called when the RTB message "Dead" occurs. This message is sent when the robot pegs out.
Reimplemented from State.
cobra_SharedServerSpecificRepository* _cobra_sharedssp | _cobra_sharedssp |
[private]
unsigned int _myID | _myID |
[private]
Position _curPos | _curPos |
[private]
double _ownAngle | _ownAngle |
[private]
Generated by: jonico on sc8-pr-shell1.sourceforge.net on Fri May 27 06:03:12 2005, using kdoc 2.0a54. |