Event (Robocode 1.2.4-Beta API)

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## robocode
Class Event

    java.lang.Object
      robocode.Event

All Implemented Interfaces:
  java.lang.Comparable<Event>

Direct Known Subclasses:
  BulletHitBulletEvent, BulletHitEvent, BulletMissedEvent, CustomEvent, DeathEvent, HitByBulletEvent, HitRobotEvent, HitWallEvent, MessageEvent, RobotDeathEvent, ScannedRobotEvent, SkippedTurnEvent, WinEvent

    public class Event

extends java.lang.Object
implements java.lang.Comparable<Event>

The basic superclass of all Robocode events

Author:
  Mathew A. Nelson (original), Flemming N. Larsen (contributor)

Constructor Summary
`Event()` Called by the game to create a new Event.

Method Summary
`int` | `compareTo(Event event)` Used for sorting events based on priority and time.
`int` | `getPriority()` Returns the priority of the event.
`long` | `getTime()` Returns the time the event occurred.
`void` | `setPriority(int newPriority)` Called by the game to set the priority of an event to the priority your robot specified for this type of event (or the default priority)
`void` | `setTime(long newTime)` Called by the game to set the time an event occurred.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Event

    public Event()

  Called by the game to create a new Event.

Method Detail

### compareTo

    public int compareTo(Event event)

  Used for sorting events based on priority and time.

  Specified by:
    `compareTo` in interface `java.lang.Comparable<Event>`

### getPriority

    public int getPriority()

  Returns the priority of the event.

  Returns:
    the priority of the event.

### getTime

    public long getTime()

  Returns the time the event occurred.

  Returns:
    the time the event occurred.

### setPriority

    public void setPriority(int newPriority)

  Called by the game to set the priority of an event to the priority your robot specified for this type of event (or the default priority)

  See Also:
    `AdvancedRobot.setEventPriority(java.lang.String, int)`

### setTime

    public void setTime(long newTime)

  Called by the game to set the time an event occurred.

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD