Class GoMokuController<B extends GoMokuBoard>
- java.lang.Object
-
- com.barrybecker4.game.common.GameController<M,B>
-
- com.barrybecker4.game.twoplayer.common.TwoPlayerController<TwoPlayerMove,B>
-
- com.barrybecker4.game.twoplayer.gomoku.GoMokuController<B>
-
- All Implemented Interfaces:
IGameController<TwoPlayerMove,B>
- Direct Known Subclasses:
TicTacToeController
public class GoMokuController<B extends GoMokuBoard> extends TwoPlayerController<TwoPlayerMove,B>
Defines everything the computer needs to know to play GoMoku.
-
-
Field Summary
-
Fields inherited from class com.barrybecker4.game.twoplayer.common.TwoPlayerController
player1sTurn, weights_
-
Fields inherited from class com.barrybecker4.game.common.GameController
gameOptions, viewer
-
-
Constructor Summary
Constructors Constructor Description GoMokuController()ConstructorGoMokuController(int nrows, int ncols)Construct the GoMoku game controller given an initial board size
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputerMovesFirst()the first move of the game (made by the computer)protected BcreateBoard()protected TwoPlayerOptionscreateOptions()protected PlayerOptionscreatePlayerOptions(java.lang.String playerName, java.awt.Color color)color is ignored right now.protected GoMokuSearchable<B>createSearchable(B board, PlayerList players)GoMokuSearchable<B>getSearchable()protected intgetWinRunLength()protected voidinitializeData()This gets the gomoku specific patterns and weights-
Methods inherited from class com.barrybecker4.game.twoplayer.common.TwoPlayerController
createPlayers, doesComputerMoveFirst, getComputerWeights, getCurrentPlayer, getExporter, getMoveList, getOptions, getSearchStrategy, getStrengthOfWin, getViewer, isDone, isOnlinePlayAvailable, isPlayer1sTurn, isProcessing, makeMove, manMoves, pause, requestComputerMove, requestComputerMove, reset, restoreFromFile, restoreFromStream, runOptimization, setGameTreeViewable, undoLastMove
-
Methods inherited from class com.barrybecker4.game.common.GameController
createServerConnection, getBoard, getLastMove, getNumMoves, getPlayers, getProfiler, getServerConnection, getServerPort, handlePlayerAction, setOptions, setPlayers, setViewer
-
-
-
-
Method Detail
-
createBoard
protected B createBoard()
- Specified by:
createBoardin classGameController<TwoPlayerMove,B extends GoMokuBoard>
-
createOptions
protected TwoPlayerOptions createOptions()
- Specified by:
createOptionsin classTwoPlayerController<TwoPlayerMove,B extends GoMokuBoard>- Returns:
- custom set of search and game options.
-
createPlayerOptions
protected PlayerOptions createPlayerOptions(java.lang.String playerName, java.awt.Color color)
Description copied from class:TwoPlayerControllercolor is ignored right now. Comes from the piece renderer- Overrides:
createPlayerOptionsin classTwoPlayerController<TwoPlayerMove,B extends GoMokuBoard>
-
initializeData
protected void initializeData()
This gets the gomoku specific patterns and weights- Specified by:
initializeDatain classGameController<TwoPlayerMove,B extends GoMokuBoard>
-
computerMovesFirst
public void computerMovesFirst()
the first move of the game (made by the computer)
-
getWinRunLength
protected int getWinRunLength()
-
getSearchable
public GoMokuSearchable<B> getSearchable()
- Overrides:
getSearchablein classTwoPlayerController<TwoPlayerMove,B extends GoMokuBoard>
-
createSearchable
protected GoMokuSearchable<B> createSearchable(B board, PlayerList players)
- Specified by:
createSearchablein classTwoPlayerController<TwoPlayerMove,B extends GoMokuBoard>
-
-