Examples of GoEyeSet


Examples of com.barrybecker4.game.twoplayer.go.board.elements.eye.GoEyeSet

     * in which case they are assumed dead and hence part of the eye.
     * @param excludedSpaceLists space lists to exclude from consideration because they are outside the group.
     * @return set of eyes in this group
     */
    private GoEyeSet findEyesFromCandidates(GoBoardPositionLists excludedSpaceLists) {
        GoEyeSet eyes = new GoEyeSet();
        boolean ownedByPlayer1 = group_.isOwnedByPlayer1();
        GroupAnalyzer groupAnalyzer = analyzerMap_.getAnalyzer(group_);

        Box innerBox = createBoxExcludingBorder(boundingBox_);
        for ( int r = innerBox.getMinRow(); r < innerBox.getMaxRow(); r++ ) {
            for ( int c = innerBox.getMinCol(); c < innerBox.getMaxCol(); c++ ) {

                // if the empty space is already marked as being an eye, skip
                GoBoardPosition space = (GoBoardPosition) board_.getPosition( r, c );
                assert space != null : "pos r="+r +" c="+c;
                if ( !space.isVisited() && space.isUnoccupied() && !space.isInEye() ) {
                    GoBoardPositionList eyeSpaces =
                            nbrAnalyzer_.findStringFromInitialPosition( space, ownedByPlayer1,
                                                                 false, NeighborType.NOT_FRIEND,
                                                                 boundingBox_  );
                    excludedSpaceLists.add(eyeSpaces);
                    // make sure this is a real eye.
                    if ( confirmEye( eyeSpaces) ) {
                        GoEye eye =  new GoEye( eyeSpaces, board_, group_, groupAnalyzer);
                        eyes.add( eye );
                    }
                    else {
                        GameContext.log(3, eyeSpaces.toString("This list of stones was rejected as being an eye: "));
                    }
                }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.eye.GoEyeSet

     * @return true if unconditionally alive
     */
    public boolean isUnconditionallyAlive() {
        initMaps();

        GoEyeSet eyes = analyzerMap_.getAnalyzer(group_).getEyes(board_);
        findNeighborStringSetsForEyes(eyes);
        createVitalEyeSets(eyes);

        return determineUnconditionalLife();
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.eye.GoEyeSet

        String newline = "\n";
        StringBuilder sb = new StringBuilder();

        sb.append(group_.toString());
        GoEyeSet eyes = getEyes(null);
        if (eyes!=null && !eyes.isEmpty())
            sb.append(eyes.toString()).append(newline);
        // make sure that the health and eyes are up to date
        sb.append("abs health=").append(FormatUtil.formatNumber(getAbsoluteHealth()));
        sb.append(" rel health=").append(FormatUtil.formatNumber(getRelativeHealth()));
        sb.append(" group Liberties=").append(getNumLiberties(null)).append('\n');
        return sb.toString();
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.eye.GoEyeSet

    /**
     * Constructor
     */
    public GroupEyeCache(IGoGroup group, GroupAnalyzerMap analyzerMap) {
        eyes_ = new GoEyeSet();
        isValid_ = false;
        eyeAnalyzer_ = new EyeSpaceAnalyzer(group, analyzerMap);
        potentialAnalyzer_ = new EyePotentialAnalyzer(group, analyzerMap);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.