|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dartra.standard.PersistentObject
org.dartra.standard.StandardHit
A hit on a standard darts board.
Constructor Summary | |
StandardHit(boolean bounceOut,
boolean illegal,
long timestamp)
Create an out-of-bounds hit, possibly a bounce-out. |
|
StandardHit(Location location,
Zone zone,
boolean illegal,
long timestamp,
boolean calculatedLocation)
Create a hit that actually hit the board. |
Method Summary | |
double |
distanceTo(Hit hit)
Calculate the distance between this hit and given hit. |
double |
distanceTo(Location location)
Calculate the distance between this hit and given location. |
boolean |
equals(java.lang.Object obj)
|
Location |
getLocation()
Returns the location that was hit, or null if the darts board was not hit (out-of-bounds). |
long |
getTimestamp()
Returns the time at which the dart hit the board. |
Zone |
getZone()
Returns the zone that was hit, or null if the darts board was not hit (out-of-bounds). |
int |
hashCode()
|
boolean |
isBounceOut()
Returns whether or not this hit was a bounce-out: the dart hit the board but it bounced out and fell on the floor. |
boolean |
isIllegal()
Returns whether or not this was a legal hit. |
boolean |
isLocationCalculated()
Returns whether or not the location for this hit was calculated or provided explicitly. |
boolean |
isOutOfBounds()
Returns whether or not this hit actually hit the darts board. |
java.lang.String |
toString()
|
Methods inherited from class org.dartra.standard.PersistentObject |
getId, setId |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.dartra.framework.Persistent |
getId, setId |
Constructor Detail |
public StandardHit(boolean bounceOut, boolean illegal, long timestamp)
Create an out-of-bounds hit, possibly a bounce-out. This hit can be legal or illegal, as indicated by the "illegal" parameter.
public StandardHit(Location location, Zone zone, boolean illegal, long timestamp, boolean calculatedLocation)
Create a hit that actually hit the board. This hit can be legal or illegal, as indicated by the "illegal" parameter.
Method Detail |
public Location getLocation()
Hit
Returns the location that was hit, or null if the darts board was not hit (out-of-bounds).
getLocation
in interface Hit
public Zone getZone()
Hit
Returns the zone that was hit, or null if the darts board was not hit (out-of-bounds).
getZone
in interface Hit
public boolean isOutOfBounds()
Hit
Returns whether or not this hit actually hit the darts board. If not, the hit is considered out-of-bounds.
isOutOfBounds
in interface Hit
public boolean isBounceOut()
Hit
Returns whether or not this hit was a bounce-out: the dart hit the board but it bounced out and fell on the floor. A bounce-out is always considered out-of-bounds.
isBounceOut
in interface Hit
public boolean isIllegal()
Hit
Returns whether or not this was a legal hit. A hit can be illegal when a player's foot extends over the throw line for instance.
isIllegal
in interface Hit
public long getTimestamp()
Hit
Returns the time at which the dart hit the board.
getTimestamp
in interface Hit
public boolean isLocationCalculated()
Hit
Returns whether or not the location for this hit was calculated or provided explicitly.
isLocationCalculated
in interface Hit
public double distanceTo(Hit hit)
Hit
Calculate the distance between this hit and given hit.
distanceTo
in interface Hit
public double distanceTo(Location location)
Hit
Calculate the distance between this hit and given location.
distanceTo
in interface Hit
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |