|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class that implements the Groups interface is responsible for maintaining a list of the groups on the board, where a group is defined as the maximal collection of stones of the same color that are connected horizontally or vertically, and so would be captured as one unit.
This interface represents the collection of groups. The SingleGroup interface represents a single group.
SingleGroup
Field Summary | |
static short |
ADD
|
static short |
COMBINE
|
static short |
SUICIDE
|
static short |
UPDATE
|
Method Summary | |
SingleGroup[] |
getCapturedSingleGroups()
Return SingleGroup objects that have been removed because of prisoner captures. |
SingleGroup[] |
getCombinedSingleGroups()
Get the SingleGroup objects that were combined. |
SingleGroup |
getNewSingleGroup()
Get the new SingleGroup object which contains the last move. |
SingleGroup |
getSingleGroup(Stone stone)
Get the SingleGroup object to which this stone belongs. |
SingleGroup[] |
getSingleGroups()
Get all of the groups on the board. |
SingleGroup[] |
getSuicidedSingleGroups()
Return all SingleGroup objects that died as a result of suicide. |
short |
getTotalSingleGroups()
Get the total number of groups on the board. |
SingleGroup |
getUpdatedSingleGroup()
Get the updated SingleGroup object which contains the last move. |
short |
status()
Return the status of the last move made. |
boolean |
wereGroupsCaptured()
Return whether any groups were captured by the last move. |
Methods inherited from interface org.moyoman.module.ModuleInterface |
clone, getMoves, getScheduler |
Field Detail |
public static final short ADD
public static final short UPDATE
public static final short COMBINE
public static final short SUICIDE
Method Detail |
public short status()
The status value is independent of whether any stones were captured by the last move.
public boolean wereGroupsCaptured()
public SingleGroup[] getSingleGroups()
public SingleGroup getSingleGroup(Stone stone) throws NoSuchDataException
stone
- The stone which is part of the single group.
NoSuchDataException
- Thrown if the stone is not on the board.public SingleGroup getNewSingleGroup() throws NoSuchDataException
NoSuchDataException
- Thrown if status() does not return ADD.public SingleGroup getUpdatedSingleGroup() throws NoSuchDataException
NoSuchDataException
- Thrown if status() does not return UPDATE.public SingleGroup[] getCombinedSingleGroups() throws NoSuchDataException
NoSuchDataException
- Thrown if status() does not return COMBINE.public SingleGroup[] getSuicidedSingleGroups() throws NoSuchDataException
NoSuchDataException
- Thrown if Board.didSuicideOccur() returns false.public short getTotalSingleGroups()
public SingleGroup[] getCapturedSingleGroups()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |