class ColumbusServerBasicState

Class ColumbusServerBasicState More...

Full nameColumbus::ColumbusServerBasicState
Definition#include <columbusserverbasestate.h>
InheritsStrategies::ServerState [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Private Members


Detailed Description

Class ColumbusServerBasicState

This class is the base of all columbus 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 simpkly call the corresponding method in this class before executinh their own stuff

 ColumbusServerBasicState (ServerCoordinator* c,ColumbusInternalServerSpecificRepository* columbusssp, ColumbusSharedServerSpecificRepository* columbussharedssp)
throw (StrategyException,bad_exception)

ColumbusServerBasicState

 ~ColumbusServerBasicState ()
throw()

~ColumbusServerBasicState

[virtual]

Destructor, does nothing

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:
distThe distance of the observed object
typeThe type of the observed object
angleThe 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:
timeThe time that has elapsed since the game had started
speedThe velocity of the robot
cannonAngleThe 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:
xAnd ...
y... are the sent coordinates
angleis 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:
energyThe unexact energy level of the detected robot
isTeamMateDefines 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. param 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:
energyThe 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:
numThe 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:
typeThe type of the hit object
angleThe 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:
warningThe type of the warning
messageThe 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.

inline string  getRobotName ()
throw ()

getRobotName

[protected]

Obtain the robot name for sub classes

ColumbusInternalServerSpecificRepository* _columbusssp

_columbusssp

[private]

string _robotName

_robotName

[private]

ostringstream _numberconv

_numberconv

[private]

ColumbusSharedServerSpecificRepository* _columbussharedssp

_columbussharedssp

[private]

static bool _newGame

_newGame

[private]

bool _2ndTry

_2ndTry

[private]

Parser::object_type _tmpWhat

_tmpWhat

[private]

double _tmp1

_tmp1

[private]

double _tmp2

_tmp2

[private]

double _tmp3

_tmp3

[private]


Generated by: jonico on sc8-pr-shell1.sourceforge.net on Fri May 27 06:03:12 2005, using kdoc 2.0a54.