|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Event
public abstract class Event
The superclass of all Robocode events.
Constructor Summary | |
---|---|
Event()
Default constructor used by the game to create a new event. |
Method Summary | |
---|---|
int |
compareTo(Event event)
Compares this event to another event regarding precedence. |
int |
getPriority()
Returns the priority of this event. |
long |
getTime()
Returns the time when this event occurred. |
void |
setPriority(int newPriority)
Changes the priority of this event. |
void |
setTime(long newTime)
Changes the time when this event occurred. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Event()
Method Detail |
---|
public int compareTo(Event event)
compareTo
in interface Comparable<Event>
event
- the event to compare to this event.
public long getTime()
Note that the time is equal to the turn of a battle round.
public void setTime(long newTime)
Note that the time is equal to the turn of a battle round.
This method is intended for letting robot developers create their own event types. It is not possible to change the time of an event after it has been added to the event queue of the robot.
newTime
- the time this event occurredpublic int getPriority()
An event priority is a value from 0 - 99. The higher value, the higher priority.
The default priority is 80, but varies depending on the type of event.
public final void setPriority(int newPriority)
The default priority is 80, but varies depending on the type of event.
This method is intended for letting robot developers create their own event types. It is not possible to change the priority of an event after it has been added to the event queue of the robot.
newPriority
- the new priority of this eventAdvancedRobot.setEventPriority(String, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |