|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Enum
robocode.control.snapshot.RobotState
public final class RobotState
Defines a robot state, which can be: active on the battlefield, hitting a wall or robot this turn, or dead.
Field Summary | |
---|---|
static RobotState |
ACTIVE
The robot is active on the battlefield and has not hit the wall or a robot at this turn. |
static RobotState |
DEAD
The robot is dead. |
static RobotState |
HIT_ROBOT
The robot has hit another robot at this turn. |
static RobotState |
HIT_WALL
The robot has hit a wall, i.e. one of the four borders, at this turn. |
Method Summary | |
---|---|
int |
getValue()
Returns the state as an integer value. |
boolean |
isAlive()
Checks if the robot is alive. |
boolean |
isDead()
Checks if the robot is dead. |
boolean |
isHitRobot()
Checks if the robot has hit another robot. |
boolean |
isHitWall()
Checks if the robot has hit the wall, i.e. one of the four borders. |
static RobotState |
toState(int value)
Returns a RobotState based on an integer value that represents a RobotState. |
static RobotState |
valueOf(String name)
|
static RobotState[] |
values()
|
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RobotState ACTIVE
public static final RobotState HIT_WALL
public static final RobotState HIT_ROBOT
public static final RobotState DEAD
Method Detail |
---|
public static RobotState[] values()
public static RobotState valueOf(String name)
public int getValue()
RobotState.toState(int)
public static RobotState toState(int value)
value
- the integer value that represents a specific RobotState.
IllegalArgumentException
- if the specified value does not correspond
to a RobotState and hence is invalid.RobotState.getValue()
public boolean isAlive()
true
if the robot is alive; false
otherwise.RobotState.isDead()
public boolean isDead()
true
if the robot is dead; false
otherwise.RobotState.isAlive()
public boolean isHitRobot()
true
if the robot has hit a robot; false
otherwise.RobotState.isHitWall()
public boolean isHitWall()
true
if the robot has hit the wall; false
otherwise.RobotState.isHitRobot()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |