Examples of NeighborAnalyzer


Examples of com.barrybecker4.game.twoplayer.go.board.analysis.neighbor.NeighborAnalyzer

     * Constructor
     * @param board board to analyze
     */
    public EmptyRegionUpdater(GoBoard board, GroupAnalyzerMap analyzerMap)  {
        board_ = board;
        nbrAnalyzer_ = new NeighborAnalyzer(board);
        analyzerMap_ = analyzerMap;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.analysis.neighbor.NeighborAnalyzer

     */
    public LifeAnalyzer(IGoGroup group, GoBoard board, GroupAnalyzerMap analyzerMap) {
        group_ = group;
        board_ = board;
        analyzerMap_ = analyzerMap;
        nbrAnalyzer_ = new NeighborAnalyzer(board);
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.analysis.neighbor.NeighborAnalyzer

     * @return a HashSet of the groups that are enemies of this group
     */
    private Set getEnemyGroupNeighbors(GoBoardPositionSet groupStones, boolean isPlayer1)  {
        GoProfiler.getInstance().startGetEnemyGroupNbrs();
        GoGroupSet enemyNbrs = new GoGroupSet();
        NeighborAnalyzer nbrAnalyzer =  new NeighborAnalyzer(board);

        // for every stone in the group.
        for (GoBoardPosition stone : groupStones) {
            GoBoardPositionSet nbrs = nbrAnalyzer.findGroupNeighbors(stone, false);
            addEnemyNeighborsForStone(enemyNbrs, stone, nbrs, isPlayer1);
        }
        GoProfiler.getInstance().stopGetEnemyGroupNbrs();
        return enemyNbrs;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.analysis.neighbor.NeighborAnalyzer

        GoBoardPosition firstStone = (GoBoardPosition) boardCopy.getPosition(firstStoneLoc);
        q.add( firstStone );
        qset.add( firstStone );
        Area area = new Area();
        NeighborAnalyzer nbrAnalyzer = new NeighborAnalyzer(boardCopy);

        while ( !q.isEmpty() ) {
            GoBoardPosition stone = (GoBoardPosition) q.remove( 0 );
            qset.remove( stone );
            stone.setVisited( true );
            visitedSet.add(stone);
            GoBoardPositionSet nbrs = nbrAnalyzer.findGroupNeighbors( stone, true );
            for (GoBoardPosition nbrStone : nbrs) {
                // accumulate all the borders to arrive at the final group border
                area.add( new Area( getBorderBetween( stone, nbrStone ) ) );
                if ( !nbrStone.isVisited() && !qset.contains( nbrStone ) ) {
                    q.add( nbrStone );
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.