|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Event
robocode.CustomEvent
This event is sent to onCustomEvent
when a custom condition is met. Be sure to reset or remove the custom condition
to avoid having it fire repeatedly.
getCondition()
Constructor Summary | |
CustomEvent(Condition condition)
Called by the game to create a new CustomEvent when a condition is met. |
|
CustomEvent(Condition condition,
int priority)
Called by the game to create a new CustomEvent when a condition is met. |
Method Summary | |
Condition |
getCondition()
Returns the condition that fired, causing this event to be generated. |
Methods inherited from class robocode.Event |
compareTo, getPriority, getTime, setPriority, setTime |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CustomEvent(Condition condition)
public CustomEvent(Condition condition, int priority)
Method Detail |
public Condition getCondition()
public void onCustomEvent(CustomEvent event) { if (event.getCondition().getName().equals("mycondition")) { removeCustomEvent(event.getCondition()); doSomethingElse(); } }
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |