|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.client.reference.util.SwingWorker | +--org.moyoman.client.reference.GameEngineSwingWorker
Provides an implementation of SwingWorker
to perform the player
actions in a separate thread. This thread manages the play using a
PlayerManager
.
PlayerManager
Nested Class Summary |
Nested classes inherited from class org.moyoman.client.reference.util.SwingWorker |
|
Field Summary | |
private Player |
_blackPlayer
Black player. |
private PlayerManager |
_playerManager
Player manager. |
private Player |
_whitePlayer
White player. |
Fields inherited from class org.moyoman.client.reference.util.SwingWorker |
|
Constructor Summary | |
GameEngineSwingWorker(Player black,
Player white,
PlayerManager playerManager)
Construct this object with the given parameters. |
Method Summary | |
Object |
construct()
Execute time-consuming code. |
Player |
getBlackPlayer()
Return the black player. |
GameRecord |
getGameRecord()
Return the game record. |
Player |
getOpponent(Player player)
Return the opponent of the given player. |
Player[] |
getPlayers()
Return the players, white then black. |
Player |
getWhitePlayer()
Return the white player. |
boolean |
isAutoMove()
Return true if auto move is set. |
void |
nextMove()
Make the next move. |
void |
setAutoMove(boolean isAutoMove)
Set single step mode. |
void |
undoMove()
Undo the last move. |
Methods inherited from class org.moyoman.client.reference.util.SwingWorker |
finished, get, getValue, interrupt, start |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Player _blackPlayer
private Player _whitePlayer
private PlayerManager _playerManager
Constructor Detail |
public GameEngineSwingWorker(Player black, Player white, PlayerManager playerManager) throws Exception
black
- Black player.white
- White player.Method Detail |
public void setAutoMove(boolean isAutoMove)
public boolean isAutoMove()
public Player getBlackPlayer()
public GameRecord getGameRecord()
public Player getOpponent(Player player)
public Player[] getPlayers()
public Player getWhitePlayer()
public Object construct()
construct
in class SwingWorker
public void nextMove()
public void undoMove() throws InconsistentStateException, InternalErrorException
InconsistentStateException
InternalErrorException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |