|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.MoveDescriptor
This class contains information about a move. This information includes the move itself, whether a ko was just captured, whether any prisoners were just captured, and any points where the next move would be illegal.
Field Summary | |
private boolean |
eogFlag
The end of the game flag. |
private Stone |
ko
The stone which playing at would illegal retake the ko. |
private String |
message
An explanation of the move. |
private Move |
move
The move being described. |
private Stone[] |
prisoners
Any prisoners captured by this move. |
private Stone[] |
suicide
Any moves which would be illegal because of suicide on the next move. |
private Stone[] |
superko
Any moves which would recreate the whole board position on the next move. |
Constructor Summary | |
MoveDescriptor(Move m)
Create a new MoveDescriptor object. |
|
MoveDescriptor(Move m,
String msg)
Create a new MoveDescriptor object. |
Method Summary | |
void |
addKo(Stone stone)
Specify a stone which cannot be played because it would illegally retake the ko. |
void |
addPrisoner(Stone stone)
Add a stone to the list of prisoners which were captured by this move. |
void |
addPrisoners(Stone[] stones)
Add stones to the list of prisoners which were captured by this move. |
void |
addSuicideMove(Stone stone)
Add a move to the list of those moves that are not legal because of suicide after this move. |
void |
addSuicideMoves(Stone[] stones)
Add moves to the list of those moves that are not legal because of suicide after this move. |
void |
addSuperKoMove(Stone stone)
Add a move to the list of those moves that are not legal because they illegally recreate the whole board position after this move. |
void |
addSuperKoMoves(Stone[] stones)
Add moves to the list of those moves that are not legal because they illegally recreate the whole board position after this move. |
Object |
clone()
Clone this object. |
Stone[] |
getIllegalMoves()
Return an array of all illegal moves. |
Stone |
getKo()
Return the stone which may not be played on the next move because it is illegally retaking the ko. |
String |
getMessage()
Get the description of the move. |
Move |
getMove()
Get the move object. |
Stone[] |
getPrisoners()
Return an array of prisoners captured by this move. |
Stone[] |
getSuicideMoves()
Get all of the moves which are illegal because of suicide. |
Stone[] |
getSuperKoMoves()
Get all of the moves which are illegal because of recreating the whole board position. |
int |
hashCode()
Get a hash code for this object. |
boolean |
isEndOfGame()
Determine whether the move has caused the end of the game. |
boolean |
isKo()
Return whether a ko was just captured. |
void |
setEndOfGame(boolean flag)
Set the end of game flag. |
void |
setMessage(String msg)
Set the description of the move. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Move move
private Stone ko
private Stone[] prisoners
private Stone[] suicide
private Stone[] superko
private String message
private boolean eogFlag
Constructor Detail |
public MoveDescriptor(Move m)
m
- The move being described.public MoveDescriptor(Move m, String msg)
m
- The move being described.msg
- A description of the move.Method Detail |
public void setMessage(String msg)
msg
- The description.public String getMessage()
public void addKo(Stone stone)
stone
- The position which cannot be played without making a ko threat first.public void addPrisoner(Stone stone)
stone
- The stone that was captured.public void addPrisoners(Stone[] stones)
stones
- The stone that were captured.public void addSuicideMove(Stone stone)
public void addSuperKoMove(Stone stone)
public void addSuicideMoves(Stone[] stones)
public void addSuperKoMoves(Stone[] stones)
public Stone getKo()
public boolean isEndOfGame()
public void setEndOfGame(boolean flag)
flag
- true if the game is over, or false.public Stone[] getSuicideMoves()
public Stone[] getSuperKoMoves()
public Stone[] getIllegalMoves()
public Move getMove()
public Stone[] getPrisoners()
public boolean isKo()
public int hashCode()
hashCode
in class Object
public Object clone()
clone
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |