game.protocol
Class AllReply
java.lang.Object
game.protocol.Reply
game.protocol.AllReply
public class AllReply
- extends Reply
Normal reply from simulator to "all?" request. Gives pretty much the whole
game state.
Invariant: mType == ALL
Constructor Summary |
AllReply(ISimulatorView sim)
A bit different in that this constructor will extract the required info
from the given sim. |
AllReply(java.lang.String msg)
Parse a normal reply |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AllReply
public AllReply(java.lang.String msg)
throws ParseException
- Parse a normal reply
- Parameters:
msg
- the message text
- Throws:
ParseException
- ill formatted message
AllReply
public AllReply(ISimulatorView sim)
- A bit different in that this constructor will extract the required info
from the given sim.
- Parameters:
sim
- model to draw data from.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getTime
public int getTime()
- Returns:
- time in milliseconds from message
getBallPosition
public CartesianVect getBallPosition()
- Returns:
- Ball's current position in meters
getBallVelocity
public PolarVect getBallVelocity()
- Returns:
- Ball's current velocity in polar coordinates
getPlayerPosition
public CartesianVect getPlayerPosition(Side t,
int p)
- Parameters:
t
- Teamp
- Player number in {0, 1, 2, 3, 4}
- Returns:
- Player's current position in meters
getPlayerVelocity
public PolarVect getPlayerVelocity(Side t,
int p)
- Parameters:
t
- Teamp
- Player number in {0, 1, 2, 3, 4}
- Returns:
- Player's current velocity in polar coordinates
isPlayerInGame
public boolean isPlayerInGame(Side t,
int p)
- Parameters:
t
- Teamp
- Player number in {0, 1, 2, 3, 4}
- Returns:
- False if player is red-carded and true otherwise