org.dartra.games.cricket
Class CricketMatch

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.cricket.CricketMatch
All Implemented Interfaces:
Game, Match, Persistent

public class CricketMatch
extends BestOfMatch

CricketMatch. A kind of best of match: first a ClosestToZoneGame is played to determine which player can start.

Author:
Bieke Meeussen

Constructor Summary
CricketMatch(StandardBoard board, Player[] players, boolean usePoints, int bestOf)
           
CricketMatch(StandardBoard board, Player[] players, StringProperties props)
           
 
Method Summary
protected  Game createNewGame()
          Subclasses should define this method appropriately.
 StringProperties getProperties()
          Subclasses should implement this to properly return their game specific properties (for instance the "start score" for an x01 game).
 java.lang.String toString()
           
 
Methods inherited from class org.dartra.standard.BestOfMatch
checkMatchWinner, countGamesWon, getBestOf, getPlayerArray, getPlayerScore, start, startNewGame
 
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.Game
addGameEventListener, getBoard, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setFirstPlayer, setWinner
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

CricketMatch

public CricketMatch(StandardBoard board,
                    Player[] players,
                    boolean usePoints,
                    int bestOf)

CricketMatch

public CricketMatch(StandardBoard board,
                    Player[] players,
                    StringProperties props)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString 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

createNewGame

protected Game createNewGame()
Description copied from class: BestOfMatch

Subclasses should define this method appropriately.

Specified by:
createNewGame in class BestOfMatch