cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class TeamChanged

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.TeamChanged
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, Event

public class TeamChanged
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent

Definition of the event TEAMCHANGE.

Complete message documentation: Aynchronous message. Response of the CHANGETEAM command.


Field Summary
protected  int DesiredTeam
          This is the team we wanted to change to (0 for red,1 for blue, etc..).
protected  UnrealId Id
          Sent only for ControlServer connections, so they know which bot changed the team.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
protected  boolean Success
          If true team change was succesfull (it won't be succesfull if we are changing to a team we already are in).
 
Constructor Summary
TeamChanged()
          Parameter-less contructor for the message.
TeamChanged(TeamChanged original)
          Cloning constructor from the full message.
TeamChanged(UnrealId Id, boolean Success, int DesiredTeam)
          Creates new instance of the message TeamChanged.
 
Method Summary
 int getDesiredTeam()
          This is the team we wanted to change to (0 for red,1 for blue, etc..).
 UnrealId getId()
          Sent only for ControlServer connections, so they know which bot changed the team.
 long getSimTime()
          Returns the simulation time when the event has occurred.
 boolean isSuccess()
          If true team change was succesfull (it won't be succesfull if we are changing to a team we already are in).
protected  void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final java.lang.String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

SimTime

protected long SimTime

Id

protected UnrealId Id
Sent only for ControlServer connections, so they know which bot changed the team.


Success

protected boolean Success
If true team change was succesfull (it won't be succesfull if we are changing to a team we already are in).


DesiredTeam

protected int DesiredTeam
This is the team we wanted to change to (0 for red,1 for blue, etc..).

Constructor Detail

TeamChanged

public TeamChanged()
Parameter-less contructor for the message.


TeamChanged

public TeamChanged(UnrealId Id,
                   boolean Success,
                   int DesiredTeam)
Creates new instance of the message TeamChanged. Aynchronous message. Response of the CHANGETEAM command. Corresponding GameBots message is TEAMCHANGE.

Parameters:
Id - Sent only for ControlServer connections, so they know which bot changed the team.
Success - If true team change was succesfull (it won't be succesfull if we are changing to a team we already are in).
DesiredTeam - This is the team we wanted to change to (0 for red,1 for blue, etc..).

TeamChanged

public TeamChanged(TeamChanged original)
Cloning constructor from the full message.

Parameters:
original -
Method Detail

getSimTime

public long getSimTime()
Description copied from interface: IWorldEvent
Returns the simulation time when the event has occurred.

Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Returns:
timestamp

setSimTime

protected void setSimTime(long SimTime)
Used by Yylex to slip correct time of the object or programmatically.


getId

public UnrealId getId()
Sent only for ControlServer connections, so they know which bot changed the team.


isSuccess

public boolean isSuccess()
If true team change was succesfull (it won't be succesfull if we are changing to a team we already are in).


getDesiredTeam

public int getDesiredTeam()
This is the team we wanted to change to (0 for red,1 for blue, etc..).


toString

public java.lang.String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public java.lang.String toHtmlString()