public class CircularImpactMunition extends UniformLinearMover implements Munition
Modifier and Type | Field and Description |
---|---|
private java.awt.geom.Point2D |
aimPoint
The center of the circle affected by this Munition.
|
private static java.text.DecimalFormat |
df
A default format for displaying numbers.
|
private boolean |
expended
True if this Munition has been fired.
|
private double |
range
The radius of the circle affected by the Munition.
|
destination, lastStopLocation, maxSpeed, movementState, moveTime, nextVelocity, ORIGIN, originalLocation, param, startMoveTime, velocity
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
CircularImpactMunition(java.awt.geom.Point2D location,
double speed,
double range)
Contructs a new CircularImpactMunition.
|
CircularImpactMunition(java.lang.String name,
java.awt.geom.Point2D location,
double speed,
double range)
Constructs a new CircularImpactMunition.
|
Modifier and Type | Method and Description |
---|---|
void |
doEndMove(CircularImpactMunition munition)
Stops this Munition at the aimpoint and schedules the Impact event for
now.
|
void |
doFire(java.awt.geom.Point2D aimPoint)
Causes this Munition to move to the given aimpoint.
|
void |
doImpact(Munition munition)
It is up to a MunitionTargetReferee to determine the effect of the Impact
event.
|
java.awt.geom.Point2D |
getAimPoint()
Returns a copy of the aimpoint.
|
java.awt.Shape |
getImpact()
Returns a Shape that is a circle with radius equal to the impactRange
centered on the aimpoint.
|
double |
getImpactRange()
The radius of the circular area that this Munition effects.
|
boolean |
isExpended()
Returns true if this Munition has been expended.
|
void |
reset()
Cancels all pending events and returns the Munition to its original
location in an un-expended state.
|
void |
setAimPoint(java.awt.geom.Point2D aimPoint)
Sets the aimpoint of this Munition and fires a property change.
|
java.lang.String |
toString()
Returns a String containing the name, current location, current velocity,
and whether or not expended of this Munition.
|
accelerate, accelerate, doEndMove, doStartMove, formatPoint, formatPoint, getAcceleration, getLocation, getMaxSpeed, getMovementState, getResetLocation, getVelocity, isMoving, magicMove, main, move, moveTo, moveTo, paramString, pause, setLocation, setMaxSpeed, setMovementState, stop, stopHere
coldReset, dumpDoMethods, dumpDoMethodsStr, dumpNamesAndSignatures, dumpNamesAndSignaturesStr, getFullMethodName, getSignatureString, handleSimEvent, isAssignableFrom, isDebug, processSimEvent, setDebug, stopAtTime, stopOnTime
addPropertyChangeListener, addPropertyChangeListener, attemptSchedule, clearAddedProperty, compareTo, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAddedProperties, getEventList, getEventListID, getName, getPriority, getPropertiesString, getProperty, getProperty, getPropertyChangeListeners, getSerial, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, isClearAddedPropertiesOnReset, isJustDefinedProperties, isPersistant, isReRunnable, isVerbose, parametersMatch, removePropertyChangeListener, removePropertyChangeListener, resetNextSerial, setClearAddedPropertiesOnReset, setEventList, setEventListID, setJustDefinedProperties, setName, setPersistant, setPriority, setProperty, setVerbose, waitDelay, waitDelay, waitDelay, waitDelay
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAcceleration, getLocation, getVelocity
getEventListID, setEventListID
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
processSimEvent
isPersistant, isReRunnable, setPersistant
getEventList, getPriority, getSerial, handleSimEvent, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, setPriority, waitDelay, waitDelay
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getAddedProperties, getProperty, getProperty, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setProperty
private java.awt.geom.Point2D aimPoint
private double range
private boolean expended
private static java.text.DecimalFormat df
public CircularImpactMunition(java.lang.String name, java.awt.geom.Point2D location, double speed, double range)
name
- The name of this Munition.location
- The initial location of this Munition.speed
- The speed of this Munition.range
- The radius of the circular area of effect for this Munition.public CircularImpactMunition(java.awt.geom.Point2D location, double speed, double range)
location
- The initial location of this Munition.speed
- The speed of this Munition.range
- The radius of the circular area of effect for this Munition.public void reset()
reset
in interface ReRunnable
reset
in class UniformLinearMover
public void doFire(java.awt.geom.Point2D aimPoint)
aimPoint
- given aimpointpublic void doEndMove(CircularImpactMunition munition)
munition
- this Munitionpublic java.awt.geom.Point2D getAimPoint()
getAimPoint
in interface Munition
public double getImpactRange()
getImpactRange
in interface Munition
public java.awt.Shape getImpact()
public boolean isExpended()
isExpended
in interface Munition
public java.lang.String toString()
toString
in class UniformLinearMover
public void doImpact(Munition munition)
public void setAimPoint(java.awt.geom.Point2D aimPoint)
setAimPoint
in interface Munition
aimPoint
- The point of impact for this Munition.