|
||||||||||
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.standard.StandardMatch
Standard implementation of the Match interface.
A match does not maintain a turn history (or throw history) directly. You will have to look at the games in the match to find the actual turns completed for the match.
Constructor Summary | |
StandardMatch(java.lang.String name,
Board board)
|
|
StandardMatch(java.lang.String name,
Board board,
Player[] players)
|
Method Summary | |
void |
accept(GameVisitor visitor)
Have given visitor process the data in this game. |
protected void |
addGame(Game game)
Add a game to the match. |
protected void |
addTurn(Turn t)
This method is not supported for matches. |
Game |
getCurrentGame()
Get the currently active game of this match. |
Player |
getCurrentPlayer()
Returns the currently active player of the match. |
Turn |
getCurrentTurn()
Returns the currently active turn of the match. |
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 match. |
void |
registerHit(Zone targetZone,
Hit hit)
Register a hit with the match. |
abstract void |
start()
Subclasses should redefine the start method appropriately. |
boolean |
undoHit()
Undo the last hit of the match. |
Methods inherited from class org.dartra.standard.StandardGame |
addGameEventListener, getBoard, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerTurn, getPlayerTurnHistory, getProperties, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setEndTime, setFirstPlayer, setPlayers, setStartTime, setWinner, 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.Game |
addGameEventListener, getBoard, getEndTime, getFirstPlayer, getGameEventListeners, getName, getPlayer, getPlayers, getPlayerScore, getPlayerTurn, getPlayerTurnHistory, getStartTime, getTurn, getTurnHistory, getWinner, removeGameEventListener, setFirstPlayer, setWinner |
Methods inherited from interface org.dartra.framework.Persistent |
getId, setId |
Constructor Detail |
public StandardMatch(java.lang.String name, Board board)
public StandardMatch(java.lang.String name, Board board, Player[] players)
Method Detail |
protected void addGame(Game game)
Add a game to the match.
public Game getGame(int index)
Match
Return specified game of this match.
getGame
in interface Match
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
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 abstract void start()
Subclasses should redefine the start method appropriately.
start
in interface Game
start
in class StandardGame
public Objective getObjective()
Get the current objective of the match. This is the objective as decided by the currently active game of the match.
getObjective
in interface Game
public void registerHit(Zone targetZone, Hit hit)
Register a hit with the match. This will register the hit with the currently active game of the match.
registerHit
in interface Game
public boolean undoHit()
Undo the last hit of the match. This will undo the last throw of the last turn of the last game. If needed, a rollback will be done to the previous turn or even to the previous game.
undoHit
in interface Game
undoHit
in class StandardGame
public Player getCurrentPlayer()
Returns the currently active player of the match. This is the current player of the currently active game of the match.
getCurrentPlayer
in interface Game
getCurrentPlayer
in class StandardGame
public Turn getCurrentTurn()
Returns the currently active turn of the match. This is the current turn of the currently active game of the match.
getCurrentTurn
in interface Game
getCurrentTurn
in class StandardGame
protected void addTurn(Turn t)
This method is not supported for matches.
addTurn
in class StandardGame
public void accept(GameVisitor visitor)
Game
Have given visitor process the data in this game.
accept
in interface Game
accept
in class StandardGame
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |