|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.games.game.Game<GridGameState> net.sourceforge.cilib.games.game.GridGame net.sourceforge.cilib.games.game.tictactoe.TicTacToe
public class TicTacToe
This is an implimentation of the game of Tic Tac Toe
Field Summary |
---|
Fields inherited from class net.sourceforge.cilib.games.game.Game |
---|
agentMeasurement, currentPlayer, players |
Constructor Summary | |
---|---|
TicTacToe()
|
|
TicTacToe(TicTacToe other)
Copy constructor |
|
TicTacToe(TicTacToe other,
GridGameState newState)
|
Method Summary | |
---|---|
void |
display()
Print the game to the console, is useful during testing. |
boolean |
gameOver()
check if the game should terminate |
List<GameState> |
generateStates(int currentPlayer)
This method generates every possible from the current state for a specific player |
Game<GridGameState> |
getClone()
Create a cloned copy of the current object and return it. |
Game<GridGameState> |
getClone(GridGameState newState)
Get a clone with the given GameState This method should typically be used by the StateTraversalStrategy and Agent with regards to decision making when playing the game. |
AbstractGameResult |
getGameResult()
Get the result of the game (Win/Lose/Draw) |
void |
initializeGame()
perform any game specific initialization |
Methods inherited from class net.sourceforge.cilib.games.game.GridGame |
---|
getHeight, getWidth, setHeight, setWidth |
Methods inherited from class net.sourceforge.cilib.games.game.Game |
---|
addMeasurement, assignPlayerScore, clearMeasurementData, clearMeasurements, getAgentMeasurements, getCurrentIteration, getCurrentPlayer, getCurrentState, getDecisionState, getDomainForPlayer, getNextPlayerID, getPlayer, getPlayerCount, getPlayerIDList, getPlayerScore, getScoringStrategy, initializeAgent, playGame, playGame, setAgent, setAgent, setCurrentGameState, setCurrentPlayer, setEntityScore, setScoringStrategy, setSeedingStrategy, setStartPlayer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TicTacToe()
public TicTacToe(TicTacToe other)
other
- public TicTacToe(TicTacToe other, GridGameState newState)
Method Detail |
---|
public void display()
display
in class Game<GridGameState>
public boolean gameOver()
gameOver
in class Game<GridGameState>
public Game<GridGameState> getClone()
getClone
in interface Cloneable
getClone
in class Game<GridGameState>
Object.clone()
public Game<GridGameState> getClone(GridGameState newState)
getClone
in class Game<GridGameState>
newState
- the new sate to use
public AbstractGameResult getGameResult()
getGameResult
in class Game<GridGameState>
public void initializeGame()
initializeGame
in class Game<GridGameState>
public List<GameState> generateStates(int currentPlayer)
generateStates
in interface StateGame
currentPlayer
- the player whos turn it is
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |