org.dartra.standard
Class StandardZone

java.lang.Object
  extended byorg.dartra.standard.PersistentObject
      extended byorg.dartra.standard.StandardZone
All Implemented Interfaces:
Persistent, Zone

public class StandardZone
extends PersistentObject
implements Zone

Zone of a standard darts board.

Author:
Erwin Vervaet

Constructor Summary
protected StandardZone(Board board, java.lang.String name, java.lang.String code, int number, int multiplier, Location center)
          Create a new standard zone.
 
Method Summary
 double distanceTo(Hit hit)
          Returns the distance between this zone and the hit location of given hit.
 double distanceTo(Location location)
          Returns the distance between this zone and given location.
 double distanceTo(Zone zone)
          Returns the distance between this zone and given zone.
 Board getBoard()
          Return the board that this zone is a part of.
 Location getCenter()
          Get the center location of the zone.
 java.lang.String getCode()
          Return the unique code of the zone.
 int getMultiplier()
          Return the multiplier associated with the zone on the darts board.
 java.lang.String getName()
          Return the name of this zone.
 int getNumber()
          Return the number associated with the zone on the darts board.
 boolean isInner()
          Returns whether or not this zone is part of the inner area of a standard darts board (inside the trebles ring).
 boolean isOuter()
          Returns whether or not this zone is part of the outer area of a standard darts board (outside the trebles ring).
 java.lang.String toString()
           
 
Methods inherited from class org.dartra.standard.PersistentObject
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

StandardZone

protected StandardZone(Board board,
                       java.lang.String name,
                       java.lang.String code,
                       int number,
                       int multiplier,
                       Location center)

Create a new standard zone.

Method Detail

getBoard

public Board getBoard()
Description copied from interface: Zone

Return the board that this zone is a part of.

Specified by:
getBoard in interface Zone

getName

public java.lang.String getName()
Description copied from interface: Zone

Return the name of this zone.

Specified by:
getName in interface Zone

getCode

public java.lang.String getCode()
Description copied from interface: Zone

Return the unique code of the zone.

Specified by:
getCode in interface Zone

getNumber

public int getNumber()
Description copied from interface: Zone

Return the number associated with the zone on the darts board.

Specified by:
getNumber in interface Zone

getMultiplier

public int getMultiplier()
Description copied from interface: Zone

Return the multiplier associated with the zone on the darts board.

Specified by:
getMultiplier in interface Zone

getCenter

public Location getCenter()
Description copied from interface: Zone

Get the center location of the zone.

Specified by:
getCenter in interface Zone

isInner

public boolean isInner()

Returns whether or not this zone is part of the inner area of a standard darts board (inside the trebles ring).


isOuter

public boolean isOuter()

Returns whether or not this zone is part of the outer area of a standard darts board (outside the trebles ring).


distanceTo

public double distanceTo(Hit hit)
Description copied from interface: Zone

Returns the distance between this zone and the hit location of given hit.

Specified by:
distanceTo in interface Zone

distanceTo

public double distanceTo(Location location)
Description copied from interface: Zone

Returns the distance between this zone and given location.

Specified by:
distanceTo in interface Zone

distanceTo

public double distanceTo(Zone zone)
Description copied from interface: Zone

Returns the distance between this zone and given zone.

Specified by:
distanceTo in interface Zone

toString

public java.lang.String toString()