|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.game.AbstractGame
org.jscience.computing.game.chess.ChessGame
public class ChessGame
ChessGame provides all external functions needed to play chess. It contains a ChessBoard which represents the game status. It overwrites equals() and hashCode() to properly support serialized games.
| Constructor Summary | |
|---|---|
ChessGame()
Creates a new ChessGame object. |
|
ChessGame(java.lang.String name)
Creates a new ChessGame object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
DOCUMENT ME! |
boolean |
equals(java.lang.Object obj)
This implementation of equals() does currently not care about the move history, it only considers the state of the board. |
boolean |
gameOver()
Current limitations: gameOver() doesn't currently check for things like insufficient material for checkmate or 3rd repititions. |
org.jscience.computing.game.chess.ChessBoard |
getBoard()
DOCUMENT ME! |
int[] |
getWinner()
DOCUMENT ME! |
int |
hashCode()
DOCUMENT ME! |
GameMove[] |
listLegalMoves()
DOCUMENT ME! |
int |
nextPlayer()
DOCUMENT ME! |
protected boolean |
popMove()
DOCUMENT ME! |
protected boolean |
pushMove(GameMove move)
DOCUMENT ME! |
protected void |
resetLists()
overwritten to provide package access |
java.lang.String |
toString()
DOCUMENT ME! |
| Methods inherited from class org.jscience.computing.game.AbstractGame |
|---|
clearRedoList, getGameName, getLastMove, getLastPlayer, getLegalMoves, getLegalMoves, getMoveHistory, getNumberOfRedoMoves, getRedoList, getResult, isLegalMove, isWinner, loadFromFile, makeMove, numberOfMoves, numberOfPlayers, redoMove, resetLegalMoves, saveToFile, spawnChild, undoLastMove, undoMoves |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChessGame()
public ChessGame(java.lang.String name)
name - DOCUMENT ME!| Method Detail |
|---|
protected void resetLists()
resetLists in class AbstractGamepublic int[] getWinner()
public boolean gameOver()
gameOver in class AbstractGamepublic int nextPlayer()
public GameMove[] listLegalMoves()
listLegalMoves in class AbstractGameprotected boolean popMove()
popMove in class AbstractGameprotected boolean pushMove(GameMove move)
pushMove in class AbstractGamemove - DOCUMENT ME!
public org.jscience.computing.game.chess.ChessBoard getBoard()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - DOCUMENT ME!
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class AbstractGame
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface GamePlayclone in class AbstractGamejava.lang.CloneNotSupportedException - DOCUMENT ME!AbstractGame.spawnChild(GameMove)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||