|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An object that implements the Board interface is responsible for maintaining the current state and history of a game.
It stores information about such things as the stones on the board, each move that has been made, all kos that have been taken and all prisoners captured, and the rule set under which the game is being played.
Field Summary | |
static short |
ALLOWED
A superko is allowed. |
static short |
DRAW
A superko results in a draw. |
static short |
FILLED
A move is made on an occupied point. |
static short |
FORBIDDEN
A superko is forbidden. |
static short |
KO
A move illegally retakes the ko. |
static short |
LEGAL
A move is legal. |
static short |
SUICIDE
A move is an illegal suicide. |
static short |
SUPERKO
A whole board position is illegally recreated. |
static short |
WRONG_COLOR
The wrong color stone is moved. |
Method Summary | |
boolean |
didSuicideOccur()
Return true if the last move was a suicide or false. |
boolean |
doCountPointsInSeki()
Return true unless territory that is part of a seki are not counted. |
boolean |
freePlacementOfHandicapStones()
Return whether handicap stones can be placed anywhere. |
NumberedStone[] |
getAllBlackPrisoners()
Return all black prisoners that have been captured in this game. |
NumberedStone[] |
getAllKos()
Return all kos that have occurred in this game. |
Move[] |
getAllMoves()
Get all of the moves that have been made in the game. |
NumberedStone[] |
getAllPrisoners()
Return all prisoners that have been captured in this game. |
NumberedStone[] |
getAllWhitePrisoners()
Return all white prisoners that have been captured in this game. |
Stone[] |
getBlackStones()
Return all of the black stones on the board. |
Color[][] |
getBoardArray()
Return the Color objects that represent the board. |
Color |
getColor(Point pt)
Return the color of the stone at the given point. |
Color |
getColorToMove()
Return the color of the player to move. |
Stone[] |
getIllegalMoves()
Get all moves which would be illegal for any reason. |
float |
getKomi()
Return the amount of the komi for this game. |
Move |
getLastMove()
Return the last move made. |
MoveDescriptor |
getLastMoveDescriptor()
Return a MoveDescriptor for the last move made. |
Stone |
getLastMoveKo()
If there is a ko situation, return the illegal move, otherwise null. |
short |
getLastMovePrisonerCount()
Get the total number of prisoners captured on the last move. |
Stone[] |
getLastMovePrisoners()
Return an array of all of the prisoners captured on the last move. |
short |
getLegalityStatus(Stone st)
Return the status of the move. |
Stone[] |
getLegalMoves()
Return all legal moves. |
short |
getMoveNumber()
Return the move number to be made next. |
short |
getStoneCount()
Return the total number of stones on the board. |
Stone[] |
getStones()
Return all of the stones on the board. |
Stone[] |
getSuicideMoves()
Get all moves which would be illegal because of suicide. |
Stone[] |
getSuperKoMoves()
Get all moves which would be illegal because of superko. |
short |
getTotalBlackPrisonerCount()
Get the total number of black prisoners in the game. |
short |
getTotalWhitePrisonerCount()
Get the total number of white prisoners in the game. |
Stone[] |
getWhiteStones()
Return all of the white stones on the board. |
boolean |
isBentFourDeadByRule()
Return whether bent four in the corner is dead by rule. |
boolean |
isEndOfGame()
Determine whether the last move caused the game to end. |
boolean |
isLegal(Stone st)
Return true if the move is legal, or false. |
boolean |
isSuicideAllowed()
Return true if suicide is allowed, or false. |
boolean |
isTerritoryScoring()
Return true for territory (Japanese) scoring, or false for area (Chinese) scoring. |
void |
makeMove(Move move)
Add a move to the board. |
boolean |
mustWhiteMoveLast()
Return true if white must make the last move, or false. |
short |
numberOfPassesToEndGame()
Return the number of consecutive passes required to end the game. |
short |
superKoRule()
Return a constant indicating the legality of superko. |
Methods inherited from interface org.moyoman.module.ModuleInterface |
clone, getMoves, getScheduler |
Field Detail |
public static final short DRAW
public static final short FORBIDDEN
public static final short ALLOWED
public static final short LEGAL
public static final short FILLED
public static final short SUICIDE
public static final short KO
public static final short SUPERKO
public static final short WRONG_COLOR
Method Detail |
public boolean isTerritoryScoring()
public boolean doCountPointsInSeki()
public boolean isSuicideAllowed()
public short superKoRule()
public boolean isBentFourDeadByRule()
public boolean mustWhiteMoveLast()
public float getKomi()
public boolean freePlacementOfHandicapStones()
public short numberOfPassesToEndGame()
public Stone getLastMoveKo()
public NumberedStone[] getAllKos()
public Stone[] getLastMovePrisoners()
public NumberedStone[] getAllPrisoners()
public NumberedStone[] getAllBlackPrisoners()
public NumberedStone[] getAllWhitePrisoners()
public Stone[] getSuperKoMoves()
public Stone[] getSuicideMoves()
public Stone[] getIllegalMoves()
public Stone[] getLegalMoves()
public boolean isLegal(Stone st)
st
- The stone to be played.
public short getLegalityStatus(Stone st)
st
- The move being checked.
public short getTotalBlackPrisonerCount()
public short getTotalWhitePrisonerCount()
public short getLastMovePrisonerCount()
public Move getLastMove() throws NoSuchDataException
NoSuchDataException
- Thrown if no moves have been made,
even if there are handicap stones on the board.public MoveDescriptor getLastMoveDescriptor() throws NoSuchDataException
NoSuchDataException
- Thrown if no moves have been made,
even if there are handicap stones on the board.public Move[] getAllMoves()
public Stone[] getBlackStones()
public Stone[] getWhiteStones()
public Stone[] getStones()
public short getStoneCount()
public short getMoveNumber()
public Color getColorToMove()
public Color getColor(Point pt)
public boolean isEndOfGame()
public Color[][] getBoardArray()
public boolean didSuicideOccur()
public void makeMove(Move move) throws IllegalMoveException, InternalErrorException
move
- The move to be added.
IllegalMoveException
- Thrown if the move is illegal.
InternalErrorException
- Thrown if the operation fails for any reason.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |