|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Hit of a dart on a darts board. A dart hits a particular zone of the board, at a particular location.
A hit can also be out-of-bounds, in which case it did not hit the board, so no location and zone information are available. A bounce-out is a special case of an out-of-bounds hit.
A third type is hit is an illegal hit, for instance when a player's foot extends over the throw line (also called a foul). An illegal hit can be out-of-bounds, or can correctly hit the board, in which case zone and location information is available.
Hits are value objects.
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. |
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). |
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. |
Methods inherited from interface org.dartra.framework.Persistent |
getId, setId |
Method Detail |
public Location getLocation()
Returns the location that was hit, or null if the darts board was not hit (out-of-bounds).
public Zone getZone()
Returns the zone that was hit, or null if the darts board was not hit (out-of-bounds).
public boolean isOutOfBounds()
Returns whether or not this hit actually hit the darts board. If not, the hit is considered out-of-bounds.
public 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. A bounce-out is always considered out-of-bounds.
public boolean isIllegal()
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.
public long getTimestamp()
Returns the time at which the dart hit the board.
public boolean isLocationCalculated()
Returns whether or not the location for this hit was calculated or provided explicitly.
public double distanceTo(Hit hit)
Calculate the distance between this hit and given hit.
public double distanceTo(Location location)
Calculate the distance between this hit and given location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |