robocode
Class ScannedProjectileEvent

java.lang.Object
  extended by robocode.Event
      extended by robocode.ScannedProjectileEvent
All Implemented Interfaces:
Serializable, Comparable<Event>

Deprecated.

@Deprecated
public class ScannedProjectileEvent
extends Event

A ScannedProjectileEvent is sent to onScannedProjectile(ScannedProjectileEvent) when you scan/found an incoming projectile. You can use the information contained in this event to determine how to react.

Since:
1.8.3.0 Alpha 1 This function was deprecated since it destroys the fun of calculating where the enemy bullets might be.
Version:
0.1
Author:
Thales B.V. / Jiri Waning
See Also:
Serialized Form

Constructor Summary
ScannedProjectileEvent(double energy, double velocity, double distance, double bearingFront, double bearingBack)
          Deprecated. Creates a new scanned projectile event.
 
Method Summary
 int compareTo(Event event)
          Deprecated. Compares this event to another event regarding precedence.
 double getBearingBackCanon()
          Deprecated. Get the bearing from the back canon to the projectile.
 double getBearingFrontCanon()
          Deprecated. Get the bearing from the front canon to the projectile.
 double getDistance()
          Deprecated. Get the distance between the projectile and the vehicle.
 double getEnergy()
          Deprecated. Get the amount of energy the projectile has been fired with.
 double getVelocity()
          Deprecated. Get the velocity at which the projectile is traveling.
 
Methods inherited from class robocode.Event
getPriority, getTime, setPriority, setTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScannedProjectileEvent

public ScannedProjectileEvent(double energy,
                              double velocity,
                              double distance,
                              double bearingFront,
                              double bearingBack)
Deprecated. 
Creates a new scanned projectile event.

Parameters:
energy - The energy at which the projectile has been fired.
velocity - The velocity at which the projectile is traveling.
distance - The distance between the vehicle and the projectile.
bearingFront - The bearing from the front canon to the projectile.
bearingBack - The bearing from the back canon to the projectile.
Method Detail

getEnergy

public double getEnergy()
Deprecated. 
Get the amount of energy the projectile has been fired with.

Returns:
The amount of energy the projectile has been fired with.

getVelocity

public double getVelocity()
Deprecated. 
Get the velocity at which the projectile is traveling.

Returns:
The velocity at which the projectile is traveling.

getDistance

public double getDistance()
Deprecated. 
Get the distance between the projectile and the vehicle.

Returns:
The distance between the projectile and the vehicle.

getBearingFrontCanon

public double getBearingFrontCanon()
Deprecated. 
Get the bearing from the front canon to the projectile.

Returns:
The bearing from the front canon to the projectile.

getBearingBackCanon

public double getBearingBackCanon()
Deprecated. 
Get the bearing from the back canon to the projectile.

Returns:
The bearing from the back canon to the projectile.

compareTo

public int compareTo(Event event)
Deprecated. 
Compares this event to another event regarding precedence. The event precedence is first and foremost determined by the event time, secondly the event priority, and lastly specific event information.

This method will first compare the time of each event. If the event time is the same for both events, then this method compared the priority of each event. If the event priorities are equals, then this method will compare the two event based on specific event information.

This method is called by the game in order to sort the event queue of a robot to make sure the events are listed in chronological order.

Specified by:
compareTo in interface Comparable<Event>
Overrides:
compareTo in class Event
Parameters:
event - the event to compare to this event.
Returns:
a negative value if this event has higher precedence, i.e. must be listed before the specified event. A positive value if this event has a lower precedence, i.e. must be listed after the specified event. 0 means that the precedence of the two events are equal.


Copyright © 2015 Robocode. All Rights Reserved.