org.dartra.games.x01
Class X01Match

java.lang.Object
  extended byorg.dartra.standard.PersistentObject
      extended byorg.dartra.standard.StandardGame
          extended byorg.dartra.standard.StandardMatch
              extended byorg.dartra.standard.BestOfMatch
                  extended byorg.dartra.games.x01.X01Match
All Implemented Interfaces:
Game, Match, Persistent

public class X01Match
extends BestOfMatch
implements Match

An x01 darts match. A match starts with a game of "closest to zone" to decide the player that will throw first. Once the first player has been selected, a number of normal x01 sets will be played to decide the winner of the match.

Author:
Erwin Vervaet

Constructor Summary
X01Match(StandardBoard board, Player[] players, int bestOf, int gamesPerSet, int startScore, boolean doubleIn, boolean doubleOut)
           
X01Match(StandardBoard board, Player[] players, StringProperties props)
           
 
Method Summary
protected  Game createNewGame()
          Create a new game for this match: an x01 set.
 StringProperties getProperties()
          Subclasses should implement this to properly return their game specific properties (for instance the "start score" for an x01 game).
 
Methods inherited from class org.dartra.standard.BestOfMatch
checkMatchWinner, countGamesWon, getBestOf, getPlayerArray, getPlayerScore, start, startNewGame, toString
 
Methods inherited from class org.dartra.standard.StandardMatch
accept, addGame, addTurn, getCurrentGame, getCurrentPlayer, getCurrentTurn, getGame, getGames, getObjective, registerHit, undoHit
 
Methods inherited from class org.dartra.standard.StandardGame
addGameEventListener, getBoard, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setEndTime, setFirstPlayer, setPlayers, setStartTime, setWinner
 
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.Match
getCurrentGame, getGame, getGames
 
Methods inherited from interface org.dartra.framework.Game
accept, addGameEventListener, getBoard, getCurrentPlayer, getCurrentTurn, getEndTime, getFirstPlayer, getGameEventListeners, getName, getObjective, getPlayer, getPlayers, getPlayerScore, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, registerHit, removeGameEventListener, setFirstPlayer, setWinner, start, undoHit
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

X01Match

public X01Match(StandardBoard board,
                Player[] players,
                StringProperties props)

X01Match

public X01Match(StandardBoard board,
                Player[] players,
                int bestOf,
                int gamesPerSet,
                int startScore,
                boolean doubleIn,
                boolean doubleOut)
Method Detail

createNewGame

protected Game createNewGame()

Create a new game for this match: an x01 set.

Specified by:
createNewGame in class BestOfMatch

getProperties

public StringProperties getProperties()
Description copied from class: StandardGame

Subclasses should implement this to properly return their game specific properties (for instance the "start score" for an x01 game).

It is legal to return null if there are no game specific properties.

Overrides:
getProperties in class BestOfMatch