|
|||||||||
| 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.puzzle.Solitaire
public class Solitaire
A one-player game where the goal is to remove all 'peggs' on the board by jumping over them one by one.
| Constructor Summary | |
|---|---|
Solitaire()
uses SolitaireSamples.getSolitiare() to initialize the game |
|
Solitaire(java.lang.String name,
int[][] board)
Instead of building the board array yourself, you can take advantage of the static methods of the class SolitaireSamples, which provides convenient standard configurations; if you build a configuration yourself, the convention for int[][] board is as follows. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
DOCUMENT ME! |
boolean |
equals(java.lang.Object obj)
DOCUMENT ME! |
double |
getResult(int playerRole)
DOCUMENT ME! |
int |
getValueAt(int column,
int row)
DOCUMENT ME! |
int |
getValueAt(org.jscience.computing.game.puzzle.SolitairePosition pos)
DOCUMENT ME! |
int[] |
getWinner()
DOCUMENT ME! |
int |
hashCode()
still experimental at this point |
boolean |
isSolved()
DOCUMENT ME! |
protected GameMove[] |
listLegalMoves()
DOCUMENT ME! |
int |
nextPlayer()
DOCUMENT ME! |
int |
pegsLeft()
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, 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 |
|---|
public Solitaire()
SolitaireSamples.getSolitaire()
public Solitaire(java.lang.String name,
int[][] board)
SolitaireSamples| Method Detail |
|---|
public int[] getWinner()
public double getResult(int playerRole)
getResult in interface GamePlaygetResult in class AbstractGameplayerRole - DOCUMENT ME!
public int nextPlayer()
protected GameMove[] listLegalMoves()
listLegalMoves in class AbstractGameprotected boolean pushMove(GameMove move)
pushMove in class AbstractGamemove - DOCUMENT ME!
protected boolean popMove()
popMove in class AbstractGamepublic boolean isSolved()
public int pegsLeft()
public int getValueAt(org.jscience.computing.game.puzzle.SolitairePosition pos)
pos - DOCUMENT ME!
public int getValueAt(int column,
int row)
throws java.lang.ArrayIndexOutOfBoundsException
column - DOCUMENT ME!row - DOCUMENT ME!
java.lang.ArrayIndexOutOfBoundsException - DOCUMENT ME!
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface GamePlayclone in class AbstractGamejava.lang.CloneNotSupportedException - DOCUMENT ME!AbstractGame.spawnChild(GameMove)public java.lang.String toString()
toString in class AbstractGamepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||