|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class that implements this interface is responsible for assigning stones to a loose group. Each stone on the board is a member of exactly one loose group. The total number of loose groups is less than or equal to the number of groups. Any two stones that are in the same group are also in the same loose group.
Field Summary | |
static short |
ADD
A new loose group was created as a result of the last move. |
static short |
COMBINE
The last move caused two or more loose groups to be combined into one. |
static short |
SUICIDE
The last move was a suicide. |
static short |
UPDATE
The last move caused an existing loose group to be updated. |
Method Summary | |
Point[] |
getAssociatedEdgePoints(SingleLooseGroup slg)
Determine if any empty points on the edge of the board are associated with this loose group. |
SingleLooseGroup[] |
getCombinedSingleLooseGroups()
Return the loose groups that were combined into a single loose group. |
SingleLooseGroup |
getNewSingleLooseGroup()
Get the new loose group created by the last move made. |
SingleLooseGroup |
getSingleLooseGroup(SingleGroup sg)
Get the loose group which contains the single group. |
SingleLooseGroup |
getSingleLooseGroup(Stone stone)
Get the loose group which contains the stone. |
SingleLooseGroup[] |
getSingleLooseGroups()
This method returns all of the loose groups. |
SingleLooseGroup[] |
getSingleLooseGroupsFullyCaptured()
Return loose groups that were completely captured on the last move. |
SingleLooseGroup[] |
getSingleLooseGroupsPartiallyCaptured()
Return loose groups that were partially captured on the last move. |
SingleLooseGroup[] |
getSplitLooseGroups()
Return the loose groups that before the last move were part of one loose group. |
SingleLooseGroup[] |
getSuicidedSingleLooseGroups()
Get the SingleLooseGroup objects which died as a result of suicide. |
SingleLooseGroup |
getUpdatedSingleLooseGroup()
Get the loose group that contains the last move made. |
short |
status()
Return the status of the last move made. |
boolean |
wasLooseGroupSplit()
Return whether any loose groups were split by the last move. |
boolean |
wereGroupsCaptured()
Return whether the last move caused the capture of any loose groups. |
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 is not dependent on whether any stones were captured.
public boolean wereGroupsCaptured()
public boolean wasLooseGroupSplit()
public SingleLooseGroup[] getSplitLooseGroups() throws NoSuchDataException
NoSuchDataException
- Thrown if wasLooseGroupSplit() is false.public SingleLooseGroup[] getSingleLooseGroups()
public SingleLooseGroup getSingleLooseGroup(SingleGroup sg) throws Exception
sg
- The group in question.
Exception
public SingleLooseGroup getSingleLooseGroup(Stone stone) throws Exception
stone
- The stone in question.
Exception
public SingleLooseGroup[] getSingleLooseGroupsPartiallyCaptured()
public SingleLooseGroup[] getSingleLooseGroupsFullyCaptured()
public SingleLooseGroup getNewSingleLooseGroup() throws NoSuchDataException
NoSuchDataException
- Thrown if status() != ADD.public SingleLooseGroup getUpdatedSingleLooseGroup() throws NoSuchDataException
NoSuchDataException
- Thrown if status() != UPDATE.public SingleLooseGroup[] getCombinedSingleLooseGroups() throws NoSuchDataException
This array will not contain any entries unless the last move caused two or more loose groups to be combined into one loose group.
NoSuchDataException
- Thrown if status() != COMBINE.public SingleLooseGroup[] getSuicidedSingleLooseGroups() throws NoSuchDataException
NoSuchDataException
- Thrown if status() != SUICIDE.public Point[] getAssociatedEdgePoints(SingleLooseGroup slg)
Obviously, it is not straightforward when to include these implicit points and when not to. The rule here is that for each stone in the loose group, consider each empty point on the horizontal and vertical edges of the board closest to that stone which is connected to it by a straight line. If there was a stone of the same color on that empty point, would it be part of the same loose group? If the answer is yes, then it is considered to be an associated edge point. This method returns all of those points. The maximum number of these points is twice the number of stones. For example, a single stone in the corner on the star point would have two associated edge points, and the rectangle formed by these three points and the corner would contain 9 empty points.
slg
- The loose group in question.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |