org.jscience.computing.game.reversi
Class ReversiGame

java.lang.Object
  extended by org.jscience.computing.game.AbstractGame
      extended by org.jscience.computing.game.reversi.ReversiGame
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, GamePlay

public class ReversiGame
extends AbstractGame

also known as Othello game

See Also:
Serialized Form

Field Summary
 int boardHeight
          DOCUMENT ME!
 int boardWidth
          DOCUMENT ME!
 
Constructor Summary
ReversiGame()
          Creates a new ReversiGame object.
ReversiGame(java.lang.String name)
          Creates a new ReversiGame object.
 
Method Summary
 java.lang.Object clone()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 int[][] getBoard()
          DOCUMENT ME!
 int getCount(int player)
          DOCUMENT ME!
 int[] getWinner()
          DOCUMENT ME!
 int hashCode()
          experimental
 GameMove[] listLegalMoves()
          DOCUMENT ME!
 int nextPlayer()
          DOCUMENT ME!
protected  boolean popMove()
          DOCUMENT ME!
protected  boolean possibleMove(int column, int row, int player)
          DOCUMENT ME!
protected  boolean pushMove(GameMove move)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.computing.game.AbstractGame
clearRedoList, gameOver, getGameName, getLastMove, getLastPlayer, getLegalMoves, getLegalMoves, getMoveHistory, getNumberOfRedoMoves, getRedoList, getResult, isLegalMove, isWinner, loadFromFile, makeMove, numberOfMoves, numberOfPlayers, redoMove, resetLegalMoves, resetLists, saveToFile, spawnChild, undoLastMove, undoMoves
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

boardWidth

public final int boardWidth
DOCUMENT ME!

See Also:
Constant Field Values

boardHeight

public final int boardHeight
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

ReversiGame

public ReversiGame()
Creates a new ReversiGame object.


ReversiGame

public ReversiGame(java.lang.String name)
Creates a new ReversiGame object.

Parameters:
name - DOCUMENT ME!
Method Detail

getWinner

public int[] getWinner()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCount

public int getCount(int player)
DOCUMENT ME!

Parameters:
player - DOCUMENT ME!
Returns:
DOCUMENT ME!

getBoard

public int[][] getBoard()
DOCUMENT ME!

Returns:
DOCUMENT ME!

nextPlayer

public int nextPlayer()
DOCUMENT ME!

Returns:
DOCUMENT ME!

listLegalMoves

public GameMove[] listLegalMoves()
DOCUMENT ME!

Specified by:
listLegalMoves in class AbstractGame
Returns:
DOCUMENT ME!

pushMove

protected boolean pushMove(GameMove move)
DOCUMENT ME!

Specified by:
pushMove in class AbstractGame
Parameters:
move - DOCUMENT ME!
Returns:
DOCUMENT ME!

popMove

protected boolean popMove()
DOCUMENT ME!

Specified by:
popMove in class AbstractGame
Returns:
DOCUMENT ME!

possibleMove

protected boolean possibleMove(int column,
                               int row,
                               int player)
DOCUMENT ME!

Parameters:
column - DOCUMENT ME!
row - DOCUMENT ME!
player - DOCUMENT ME!
Returns:
DOCUMENT ME!

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
DOCUMENT ME!

Specified by:
clone in interface GamePlay
Overrides:
clone in class AbstractGame
Returns:
DOCUMENT ME!
Throws:
java.lang.CloneNotSupportedException - DOCUMENT ME!
See Also:
AbstractGame.spawnChild(GameMove)

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class AbstractGame
Returns:
DOCUMENT ME!

hashCode

public int hashCode()
experimental

Overrides:
hashCode in class java.lang.Object
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object obj)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!