Examples of GoBoardPositionLists


Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

     * @return the set of eyes that are in this group.
     */
    public GoEyeSet determineEyes() {

        assert (board_ != null) : "The board must be set before determining eyes.";
        GoBoardPositionLists excludedSpaceLists = createExcludedLists();
        return findEyesFromCandidates(excludedSpaceLists);
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

     * then empty spaces there are most likely eyes (but not necessarily).
     * @return list of lists of eye space spaces find real eye from (and to unvisit at the end)
     */
    private GoBoardPositionLists createExcludedLists() {

        GoBoardPositionLists lists = new GoBoardPositionLists();
        boolean ownedByPlayer1 = group_.isOwnedByPlayer1();

        if (boundingBox_.getArea() == 0) return lists;
        int rMin = boundingBox_.getMinRow();
        int rMax = boundingBox_.getMaxRow();
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

        IGoGroup group = string.getGroup();
        GoBoardPositionSet nbrs =
            nbrAnalyzer_.getNobiNeighbors( stone, group.isOwnedByPlayer1(), NeighborType.FRIEND );

        if ( nbrs.size() > 1 ) {
            GoBoardPositionLists lists = new GoBoardPositionLists();
            GoBoardPosition firstNbr = nbrs.getOneMember();
            GoBoardPositionList stones = nbrAnalyzer_.findStringFromInitialPosition( firstNbr, false );
            lists.add( stones );
            for ( GoBoardPosition nbrStone : nbrs ) {
                if ( !nbrStone.isVisited() ) {
                    GoBoardPositionList stones1 = nbrAnalyzer_.findStringFromInitialPosition( nbrStone, false );
                    IGoString newString = new GoString( stones1, getBoard() );
                    group.addMember(newString);
                    lists.add( stones1 );
                }
            }
            lists.unvisitPositionsInLists();
        }
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

        GoBoard goBoard = (GoBoard) board;
        super.modifyCaptures( goBoard, false );

        GameContext.log(3, "GoMove: restoring these captures: " + this);

        GoBoardPositionLists strings = getRestoredStringLists(goBoard)// XXX should remove
        adjustStringLiberties(goBoard);

        // XXX should remove next lines
        IGoGroup group = getRestoredGroup(strings, goBoard);
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

     * @return list of strings that were restored on the board.
     */
    private GoBoardPositionLists getRestoredStringLists(GoBoard b) {

        GoBoardPositionList restoredList = getRestoredList(b);
        GoBoardPositionLists strings = new GoBoardPositionLists();
        NeighborAnalyzer nbrAnalyzer = new NeighborAnalyzer(b);
        for (GoBoardPosition s : restoredList) {
            if (!s.isVisited()) {
                GoBoardPositionList string1 = nbrAnalyzer.findStringFromInitialPosition(s, false);
                strings.add(string1);
            }
        }
        return strings;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.position.GoBoardPositionLists

        int min = 1;
        int rMax = board_.getNumRows();
        int cMax = board_.getNumCols();
        Box box = new Box(min, min, rMax, cMax);

        GoBoardPositionLists emptyLists = new GoBoardPositionLists();

        for ( int i = min; i <= rMax; i++ )  {
           for ( int j = min; j <= cMax; j++ ) {
               GoBoardPosition pos = (GoBoardPosition)board_.getPosition(i, j);
               diffScore += updateEmptyRegionFromSeed(box, emptyLists, pos);
           }
        }

        emptyLists.unvisitPositionsInLists();
        return diffScore;
    }
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.