cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages
Class NfoMessage

Package class diagram package NfoMessage
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.usar2004.communication.messages.GBEvent
          extended by cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages.NfoMessage
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldEventWrapper, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class NfoMessage
extends GBEvent
implements cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent

When we connect to USARSim, we can send this command before spawning any robot: GETSTARTPOSES. We will receive a string like this one: NFO {StartPoses 3} {BlueGoal -2.55,-0.00,-0.19 0.00,-0.03,-0.01 MiddleField 0.01,- 0.00,-0.19 0.00,0.00,0.00 YellowGoal 2.57,-0.01,-0.19 0.00,0.00,3.13} The syntax of this string doesn't follow strictly the USARSim standard. NFO message is also issued after connecting to the USARSIM server. And it contains information about the level. Corresponding GameBots message is NFO.


Field Summary
protected  String GameType
           
protected  String Level
           
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  int StartPoseCount
           
protected  List<StartPose> StartPoses
           
protected  double TimeLimit
           
 
Constructor Summary
NfoMessage()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
NfoMessage(double TimeLimit, String Level, String GameType, int StartPoseCount)
           
NfoMessage(NfoMessage original)
          Cloning constructor.
 
Method Summary
 String getGameType()
          Initial NFO message recieved from the server will provide information such as Game Type.
 String getLevel()
          Initial NFO message recieved from the server will provide information such as Level Name.
 int getStartPoseCount()
          StartPoseCount is the number of starting positions available.
 List<StartPose> getStartPoses()
          GETSTARTPOSES will cause receipt of the NFO message with potencial Locations for spawning a robot.
 double getTimeLimit()
          Initial NFO message recieved from the server will provide information such as Time Limit.
 String toHtmlString()
          Gets all properties and values to create a HTML formated string;
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.usar2004.communication.messages.GBEvent
getSimTime, getWorldEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent
getSimTime
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent
getSimTime
 

Field Detail

PROTOTYPE

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

See Also:
Constant Field Values

GameType

protected String GameType

Level

protected String Level

TimeLimit

protected double TimeLimit

StartPoseCount

protected int StartPoseCount

StartPoses

protected List<StartPose> StartPoses
Constructor Detail

NfoMessage

public NfoMessage(double TimeLimit,
                  String Level,
                  String GameType,
                  int StartPoseCount)

NfoMessage

public NfoMessage(NfoMessage original)
Cloning constructor.


NfoMessage

public NfoMessage()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getGameType

public String getGameType()
Initial NFO message recieved from the server will provide information such as Game Type.

Returns:
Returns a Unreal type of current game.

getLevel

public String getLevel()
Initial NFO message recieved from the server will provide information such as Level Name.

Returns:
Returns name of current map.

getTimeLimit

public double getTimeLimit()
Initial NFO message recieved from the server will provide information such as Time Limit.

Returns:
Returns the time limit for current map.

getStartPoseCount

public int getStartPoseCount()
StartPoseCount is the number of starting positions available. For every starting position you'll be able to receive it's tag, location and orientation:

Returns:
Returns number of availible start positions.

getStartPoses

public List<StartPose> getStartPoses()
GETSTARTPOSES will cause receipt of the NFO message with potencial Locations for spawning a robot.

Returns:
Returns list of possible starting positions.

toString

public String toString()
Overrides:
toString in class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage

toHtmlString

public String toHtmlString()
Gets all properties and values to create a HTML formated string;

Returns:
Returns all properties in HTML format


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