Examples of GoString


Examples of com.barrybecker4.game.twoplayer.go.board.elements.string.GoString

            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.string.GoString

       GoBoardPositionSet nbrs = nbrAnalyzer_.getNobiNeighbors( stone, NeighborType.FRIEND );

        if ( nbrs.size() == 0 ) {
            // there are no strongly connected neighbors, create a new string
            new GoString( stone, getBoard())// stone points to the new string
        }
        else {
            updateNeighborStringsAfterMove(stone, nbrs);
        }
        cleanupGroups();
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.string.GoString

     * @param nbrs neighbors
     */
    private void updateNeighborStringsAfterMove(GoBoardPosition stone, GoBoardPositionSet nbrs) {

        GoBoardPosition nbrStone = nbrs.getOneMember();
        GoString str = (GoString) nbrStone.getString();
        str.addMember( stone, getBoard() );
        getAllGroups().debugPrint( 3, "groups before merging:", true, true);

        if ( nbrs.size() > 1 ) {
            mergeStringsIfNeeded(str, nbrs);
        }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.string.GoString

    private IGoGroup getRestoredGroup(List<GoBoardPositionList> strings, GoBoard b) {
        // ?? form new group, or check group nbrs to see if we can add to an existing one.
        boolean firstString = true;
        IGoGroup group = null;
        for  (GoBoardPositionList stringList : strings) {
            IGoString string = new GoString( stringList, b );
            if ( firstString ) {
                group = new GoGroup( string );
                firstString = false;
            }
            else {
                group.addMember(string);
            }
            string.setVisited(false);
        }
        return group;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.string.GoString

            for ( int j = 1; j <= board_.getNumCols(); j++ ) {
                GoBoardPosition pos = (GoBoardPosition)board_.getPosition(i, j);
                if (pos.isOccupied()) {
                    IGoString existingString = strings.findStringContainingPosition(pos);
                    if (existingString == null) {
                        GoString str = new GoString(findStringFromInitialPosition(pos, true), board_);
                        strings.add(str);
                        pos.setString(str);
                    }
                    else {
                        pos.setString(existingString);
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.