|
||||||||||
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.StandardGame
org.dartra.games.cricket.CricketGame
org.dartra.games.cricket.ScramCricketGame
CricketGame version where one player is the blocker, and the other one is the scorer. A number hit once by the blocker, cannot be hit by the scorer anymore. When the blocker has closed all numbers, the roles are switched. The winner is the player that can score the most points.
Nested Class Summary | |
class |
ScramCricketGame.ScramCricketGamePart
One part of the ScramCricketGame; Player 0 is the blocker and player 1 the scorer |
Field Summary | |
protected static java.lang.String[] |
DEFAULT_SCRAM_GOALS
|
Fields inherited from class org.dartra.games.cricket.CricketGame |
DEFAULT_GOALS, goalsMap |
Constructor Summary | |
ScramCricketGame(StandardBoard board,
Player[] players)
|
|
ScramCricketGame(StandardBoard board,
Player[] players,
StringProperties props)
|
Method Summary | |
protected void |
addGame(Game game)
Add a game to the match. |
protected void |
checkScramGameOver()
Checks if this game has a winner, and sets the winner. |
Game |
getCurrentGame()
Get the currently active game of this match. |
Player |
getCurrentPlayer()
Returns the current player of the game, the player that is currently on throw. |
Game |
getGame(int index)
Return specified game of this match. |
java.util.Vector |
getGames()
Return a list of all games played in this match so far. |
Objective |
getObjective()
Get the current objective of the game: the current player should try to hit a zone of the board, or should end this turn. |
Score |
getPlayerScore(Player player)
Get the current score for given player in this game. |
void |
registerHit(Zone targetZone,
Hit hit)
Register the hit of a dart on the board. |
void |
start()
Starts the scram game. |
protected void |
startNewGame()
Starts a new game in this match. |
Methods inherited from class org.dartra.games.cricket.CricketGame |
addHitToTracker, addPlayerThrow, addTurnToTracker, calculateWinner, changePlayer, createTracker, emptyTurn, findPlace, gameOver, getGoals, getGoalsMap, getProperties, highestScoreNumber, highestScoreZone, isClosedByOtherPlayer, isClosedByPlayer, isUsePoints, multiplierToClose, score, setGoals, setUsePoints, suggestZone, toString, turnOver, wasClosedByOtherPlayer, wasClosedByPlayer, zoneToCloseHighestOpenForPlayer |
Methods inherited from class org.dartra.standard.StandardGame |
accept, addGameEventListener, addTurn, getBoard, getCurrentTurn, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setEndTime, setFirstPlayer, setPlayers, setStartTime, setWinner, undoHit |
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 |
accept, addGameEventListener, getBoard, getCurrentTurn, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setFirstPlayer, setWinner, undoHit |
Methods inherited from interface org.dartra.framework.Persistent |
getId, setId |
Field Detail |
protected static final java.lang.String[] DEFAULT_SCRAM_GOALS
Constructor Detail |
public ScramCricketGame(StandardBoard board, Player[] players)
public ScramCricketGame(StandardBoard board, Player[] players, StringProperties props)
Method Detail |
public void start()
Starts the scram game. Sets the starting time, and starts the first part.
start
in interface Game
start
in class StandardGame
protected void startNewGame()
Starts a new game in this match.
public Objective getObjective()
Game
Get the current objective of the game: the current player should try to hit a zone of the board, or should end this turn.
getObjective
in interface Game
getObjective
in class CricketGame
Game.getObjective()
public void registerHit(Zone targetZone, Hit hit)
Game
Register the hit of a dart on the board. A particular zone of the board was targetted.
registerHit
in interface Game
registerHit
in class CricketGame
Game.registerHit(org.dartra.framework.Zone, org.dartra.framework.Hit)
public Score getPlayerScore(Player player)
Game
Get the current score for given player in this game.
getPlayerScore
in interface Game
getPlayerScore
in class CricketGame
Game.getPlayerScore(org.dartra.framework.Player)
protected void checkScramGameOver()
Checks if this game has a winner, and sets the winner. The winner is the player that scored most as a scorer.
protected void addGame(Game game)
Add a game to the match.
public Game getCurrentGame()
Get the currently active game of this match. For a standard match, this is the last game of the match, or null if the match does not yet contain any games.
getCurrentGame
in interface Match
public Game getGame(int index)
Match
Return specified game of this match.
getGame
in interface Match
public Player getCurrentPlayer()
Game
Returns the current player of the game, the player that is currently on throw.
getCurrentPlayer
in interface Game
getCurrentPlayer
in class StandardGame
public java.util.Vector getGames()
Match
Return a list of all games played in this match so far. The returned list contains Game objects.
getGames
in interface Match
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |