rcssjava.comm
Class CoachCommandHandler

java.lang.Object
  extended by rcssjava.comm.CoachCommandHandler
Direct Known Subclasses:
TrainerCommandHandler

public class CoachCommandHandler
extends java.lang.Object

Handles contruction of outgoing commands to the server for online coaches and offline trainers. This class contains all of the commands that a coach can send, which is a subset of what a trainer can send.

See Also:
TrainerCommandHandler

Field Summary
protected  Connection C
           
protected  WorldState WS
           
 
Constructor Summary
CoachCommandHandler(Connection c)
          Constructs a command handler with a null world state
CoachCommandHandler(Connection c, WorldState ws)
          Constructs a command handler with the given world state
 
Method Summary
 void changePlayerType(int id, int playerType)
          Change the heterogenous player type of a given player.
 void done()
          Tell server thinking time is over.
 void eye(boolean mode)
          Turn "see" messages on or off
 void init(java.lang.String teamName, double version)
          Send init message to server
 void say(java.lang.String message)
          Send say message to server
 void setWorldState(WorldState ws)
          Connect the parser to the supplied world state
 void teamNames()
          Request team names message from server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected Connection C

WS

protected WorldState WS
Constructor Detail

CoachCommandHandler

public CoachCommandHandler(Connection c)
Constructs a command handler with a null world state

Parameters:
c - connection
See Also:
setWorldState(WorldState)

CoachCommandHandler

public CoachCommandHandler(Connection c,
                           WorldState ws)
Constructs a command handler with the given world state

Parameters:
c - connection
ws - world state to connect to this parser
Method Detail

setWorldState

public void setWorldState(WorldState ws)
Connect the parser to the supplied world state

Parameters:
ws - world state to connect to this parser

init

public void init(java.lang.String teamName,
                 double version)
Send init message to server

Parameters:
teamName - name of team to coach
version - protocol version number supported

say

public void say(java.lang.String message)
Send say message to server

Parameters:
message -

changePlayerType

public void changePlayerType(int id,
                             int playerType)
Change the heterogenous player type of a given player. This version ensures that the player is on the coach's team

Parameters:
id - player ID of player to change
playerType - new heterogenous type for player

eye

public void eye(boolean mode)
Turn "see" messages on or off

Parameters:
mode - set to true to turn "see" messages on

teamNames

public void teamNames()
Request team names message from server


done

public void done()
Tell server thinking time is over. Used in synchronous mode