org.jscience.computing.game.gomoku
Class GomokuGame

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

public class GomokuGame
extends AbstractGame

an implementation of the game Go-moku

See Also:
Serialized Form

Field Summary
static int EMPTY
          DOCUMENT ME!
 
Constructor Summary
GomokuGame()
          Creates a new GomokuGame object.
GomokuGame(java.lang.String name, int width, int height)
          Creates a new GomokuGame object.
 
Method Summary
protected  int checkPositionWin(int column, int row)
          DOCUMENT ME!
 java.lang.Object clone()
          DOCUMENT ME!
 int getHeight()
          DOCUMENT ME!
 int getValueAt(int column, int row)
          DOCUMENT ME!
 int getWidth()
          DOCUMENT ME!
 int[] getWinner()
          DOCUMENT ME!
protected  GameMove[] listLegalMoves()
          DOCUMENT ME!
 int nextPlayer()
          DOCUMENT ME!
protected  boolean popMove()
          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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final int EMPTY
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

GomokuGame

public GomokuGame()
Creates a new GomokuGame object.


GomokuGame

public GomokuGame(java.lang.String name,
                  int width,
                  int height)
Creates a new GomokuGame object.

Parameters:
name - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!
Method Detail

listLegalMoves

protected 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!

nextPlayer

public int nextPlayer()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getWinner

public int[] getWinner()
DOCUMENT ME!

Returns:
DOCUMENT ME!

checkPositionWin

protected int checkPositionWin(int column,
                               int row)
DOCUMENT ME!

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

getValueAt

public int getValueAt(int column,
                      int row)
               throws java.lang.ArrayIndexOutOfBoundsException
DOCUMENT ME!

Parameters:
column - DOCUMENT ME!
row - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ArrayIndexOutOfBoundsException - DOCUMENT ME!

getWidth

public int getWidth()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getHeight

public int getHeight()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toString

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

Overrides:
toString in class AbstractGame
Returns:
DOCUMENT ME!

clone

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

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