T
- specify the corresponding Game class to that being played on the server. Corresponds to the same class used by the Spaceship
interface.public class Environment<T>
extends java.lang.Object
Spaceship.getNextCommand(Environment)
method of the Spaceship
class to inform the ship of
the current state of your ship and the world.
The Environment may contain additional information based on performing other commands like RadarCommand
.Constructor and Description |
---|
Environment() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Environment<T> other)
Determines if this Environment is the same as another one.
|
T |
getGameInfo()
Gets information concerning the current game objective.
|
java.lang.String[] |
getMessages()
Gets a list of messages currently received.
|
RadarResults |
getRadar()
Gets the results of the most recent radar sweep, if and only if the last command issued was a
RadarCommand . |
int |
getRadarLevel()
Gets the level of the last radar sweep, if the last command issued was a
RadarCommand . |
ObjectStatus |
getShipStatus()
Gets the status of your ship.
|
java.lang.String |
toString() |
public java.lang.String[] getMessages()
public int getRadarLevel()
RadarCommand
.RadarCommand
.public RadarResults getRadar()
RadarCommand
.RadarCommand
,
or null if the last command issued was not a radar sweeppublic ObjectStatus getShipStatus()
public T getGameInfo()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(Environment<T> other)
other
- the Environment to compare to