|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.problems.tictactoe.model.Logic
public abstract class Logic
Contains logic for a particular TicTacToe Variation about how to interpret the attempt to select a cell (Col, Row) as the desired move. Note: This will not capture all cases, but will get most.
Constructor Summary | |
---|---|
Logic()
|
Method Summary | |
---|---|
abstract Logic |
copy()
Each logic must implement 'copy' to properly be used when evaluating future moves. |
void |
initializeState(TicTacToeState state)
Enable variations to instantiate the stored data with each game state. |
abstract Move |
interpretMove(IGameState board,
int col,
int row,
Player player)
Method to determine the type of move that the user has selected. |
int |
maxNumberMoves()
Most TicTacToe variations are guaranteed to have a fixed number of moves before the game is either won, lost, or drawn. |
abstract java.lang.String |
rules()
Return a description of the game and how it is to be played. |
IGameScore |
score()
Each logic may have its own evaluation function to use, which would override the default evaluation stored with the game state. |
java.util.Collection<IGameMove> |
validMoves(IPlayer ip,
IGameState state)
Return the valid moves at this board state for the given player. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Logic()
Method Detail |
---|
public abstract Move interpretMove(IGameState board, int col, int row, Player player)
board
- current board statecol
- selected columnrow
- selected rowplayer
- player making the move
public java.util.Collection<IGameMove> validMoves(IPlayer ip, IGameState state)
public IGameScore score()
public abstract Logic copy()
public int maxNumberMoves()
public void initializeState(TicTacToeState state)
public abstract java.lang.String rules()
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |