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

Package class diagram package 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, cz.cuni.amis.utils.listener.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 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()
          Simulation time in MILLI SECONDS !!!
 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.
 String toHtmlString()
           
 String toJsonLiteral()
           
 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 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()
Simulation time in MILLI SECONDS !!!

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

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 String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()

toJsonLiteral

public String toJsonLiteral()
Overrides:
toJsonLiteral in class InfoMessage


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.