org.jscience.computing.game.muehle
Class MuehleGame

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

public class MuehleGame
extends AbstractGame

a representation of the game of Muehle

See Also:
MuehlePosition, Serialized Form

Field Summary
static int EMPTY
          DOCUMENT ME!
static int NUMBER_OF_PIECES
          DOCUMENT ME!
 
Constructor Summary
MuehleGame()
          Creates a new MuehleGame object.
MuehleGame(java.lang.String name)
          Creates a new MuehleGame object.
 
Method Summary
 boolean allInMuehle(int player)
          DOCUMENT ME!
 java.lang.Object clone()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 int getRemainingInHand(int player)
          DOCUMENT ME!
 int getValueAt(MuehlePosition pos)
          DOCUMENT ME!
 int[] getWinner()
          DOCUMENT ME!
 int hashCode()
          still experimental
 boolean isInMuehle(int pos, int player)
          isInMuehle() returns true only if a pair of corresponding Positions to the given MuehlePosition contain pieces of the same player as given.
protected  GameMove[] listLegalMoves()
          DOCUMENT ME!
 int nextPlayer()
          DOCUMENT ME!
 int piecesLeft(int player)
          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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NUMBER_OF_PIECES

public static final int NUMBER_OF_PIECES
DOCUMENT ME!

See Also:
Constant Field Values

EMPTY

public static final int EMPTY
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

MuehleGame

public MuehleGame()
Creates a new MuehleGame object.


MuehleGame

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

Parameters:
name - DOCUMENT ME!
Method Detail

listLegalMoves

protected GameMove[] listLegalMoves()
DOCUMENT ME!

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

nextPlayer

public int nextPlayer()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getWinner

public int[] getWinner()
DOCUMENT ME!

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!

getValueAt

public int getValueAt(MuehlePosition pos)
DOCUMENT ME!

Parameters:
pos - DOCUMENT ME!
Returns:
DOCUMENT ME!

isInMuehle

public boolean isInMuehle(int pos,
                          int player)
isInMuehle() returns true only if a pair of corresponding Positions to the given MuehlePosition contain pieces of the same player as given.

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

allInMuehle

public boolean allInMuehle(int player)
DOCUMENT ME!

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

piecesLeft

public int piecesLeft(int player)
DOCUMENT ME!

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

getRemainingInHand

public int getRemainingInHand(int player)
DOCUMENT ME!

Parameters:
player - 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()
                       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()
still experimental

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