org.jscience.computing.game.mine
Class MineSweeper

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

public class MineSweeper
extends AbstractGame

An implementation of the game Mine Sweeper

Since:
9/14/2002
See Also:
Serialized Form

Constructor Summary
MineSweeper()
          calls this(30, 16, 99, System.currentTimeMillis())
MineSweeper(int width, int height, int numberOfMines, long randomSeed)
          Creates a new MineSweeper object.
MineSweeper(int width, int height, int numberOfMines, java.util.Random random)
          Creates a new MineSweeper object.
 
Method Summary
 java.lang.Object clone()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 int getHeight()
          DOCUMENT ME!
 int getWidth()
          DOCUMENT ME!
 int[] getWinner()
          DOCUMENT ME!
 int hashCode()
          DOCUMENT ME!
 boolean isOpen(int column, int row)
          DOCUMENT ME!
protected  GameMove[] listLegalMoves()
          DOCUMENT ME!
 int nextPlayer()
          DOCUMENT ME!
protected  boolean popMove()
          always returns false
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
 

Constructor Detail

MineSweeper

public MineSweeper()
calls this(30, 16, 99, System.currentTimeMillis())


MineSweeper

public MineSweeper(int width,
                   int height,
                   int numberOfMines,
                   long randomSeed)
Creates a new MineSweeper object.

Parameters:
width - DOCUMENT ME!
height - DOCUMENT ME!
numberOfMines - DOCUMENT ME!
randomSeed - DOCUMENT ME!

MineSweeper

public MineSweeper(int width,
                   int height,
                   int numberOfMines,
                   java.util.Random random)
Creates a new MineSweeper object.

Parameters:
width - DOCUMENT ME!
height - DOCUMENT ME!
numberOfMines - DOCUMENT ME!
random - DOCUMENT ME!
Method Detail

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)

equals

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

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

hashCode

public int hashCode()
DOCUMENT ME!

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

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()
always returns false

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!

getWidth

public int getWidth()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getHeight

public int getHeight()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isOpen

public boolean isOpen(int column,
                      int row)
DOCUMENT ME!

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

toString

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

Overrides:
toString in class AbstractGame
Returns:
DOCUMENT ME!