robocode.robotinterfaces

Interface IAdvancedEvents

Known Implementing Classes:
AdvancedRobot, TeamRobot

public interface IAdvancedEvents

An event interface for receiving advanced robot events with an IAdvancedRobot.
Authors:
Pavel Savara (original)
Flemming N. Larsen (javadoc)
Since:
1.6
See Also:
IAdvancedRobot

Method Summary

void
onCustomEvent(CustomEvent event)
This method is called when a custom condition is met.
void
onSkippedTurn(SkippedTurnEvent event)
This method is called if the robot is using too much time between actions.

Method Details

onCustomEvent

public void onCustomEvent(CustomEvent event)
This method is called when a custom condition is met.

See the sample robots for examples of use, e.g. the sample.Target robot.

Parameters:
event - the custom event that occurred

onSkippedTurn

public void onSkippedTurn(SkippedTurnEvent event)
This method is called if the robot is using too much time between actions. When this event occur, the robot's turn is skipped, meaning that it cannot take action anymore in this turn.

If you receive 30 skipped turn event, your robot will be removed from the round and loose the round.

You will only receive this event after taking an action. So a robot in an infinite loop will not receive any events, and will simply be stopped.

No correctly working, reasonable robot should ever receive this event unless it is using too many CPU cycles.

Parameters:
event - the skipped turn event set by the game