The enum RobotState is only used in the core of RoboCode. There is no getState()
method for your robot. (i digged through the source code)
However: you can get all theses state in other ways:
If your robot is hitting a wall, a HitWall event is fired. you can handle those events by overriding a method in your robot class:
@Override
public void onHitWall(HitWallEvent e)
{
//your code
}
same with hitting a robot:
@Override
public void onHitRobot(HitRobotEvent e)
{
//your code
}
if your robot dies:
@Override
public void onRobotDeath(RobotDeathEvent event)
{
//salute your warrior
//your code
}
and if it's alive it should still loop in your runs method:
@Override
public void run() {
do {
//here you do the normal stuff a robot does
} while(true);
}
You can look at even more event methods in this interfaces: