|
||||||||||
| 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()
HitReturns the location that was hit, or null if the darts board was not hit (out-of-bounds).
getLocation in interface Hitpublic Zone getZone()
HitReturns the zone that was hit, or null if the darts board was not hit (out-of-bounds).
getZone in interface Hitpublic boolean isOutOfBounds()
HitReturns whether or not this hit actually hit the darts board. If not, the hit is considered out-of-bounds.
isOutOfBounds in interface Hitpublic boolean isBounceOut()
HitReturns 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 Hitpublic boolean isIllegal()
HitReturns 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 Hitpublic long getTimestamp()
HitReturns the time at which the dart hit the board.
getTimestamp in interface Hitpublic boolean isLocationCalculated()
HitReturns whether or not the location for this hit was calculated or provided explicitly.
isLocationCalculated in interface Hitpublic double distanceTo(Hit hit)
HitCalculate the distance between this hit and given hit.
distanceTo in interface Hitpublic double distanceTo(Location location)
HitCalculate the distance between this hit and given location.
distanceTo in interface Hitpublic 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 | |||||||||