Examples of IGoString


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

    /**
     * @param stone verify that this stone has a valid string and a group in the board's member list.
     */
    public void confirmStoneInValidGroup(GoBoardPosition stone) {
        IGoString str = stone.getString();
        assert ( str!=null) : stone + " does not belong to any string!" ;
        IGoGroup g = str.getGroup();
        boolean valid = false;
        Iterator gIt = this.iterator();
        IGoGroup g1;
        while ( !valid && gIt.hasNext() ) {
            g1 = (IGoGroup) gIt.next();
View Full Code Here

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

        GoStringSet strings = new GoStringSet();
        for ( int i = 1; i <= board_.getNumRows(); i++ )  {
            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);
                    }
View Full Code Here

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

            Iterator<IGoString> it = candidateStrings.iterator();

            done = true;
            while (it.hasNext()) {

                IGoString str = it.next();
                int numLivingAdjacentEyes = findNumLivingAdjacentEyes(str);
                if (numLivingAdjacentEyes < 2) {
                    str.setUnconditionallyAlive(false);
                    it.remove();
                    done = false; // something changed
                }
            }
View Full Code Here

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

     * @return eyePotential - a measure of how easily this group can make 2 eyes (0 - 2; 2 meaning has 2 eyes).
     */
    private float findTotalEyePotential() {

        if (group_.getMembers().isEmpty()) return 0;
        IGoString groupString = group_.getMembers().iterator().next();

        int rMin = boundingBox_.getMinRow();
        int rMax = boundingBox_.getMaxRow();
        int cMin = boundingBox_.getMinCol();
        int cMax = boundingBox_.getMaxCol();
View Full Code Here

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

        GoBoardPosition space = (GoBoardPosition) ((IRectangularBoard)controller_.getBoard()).getPosition( loc );
        if ( space != null && GameContext.getDebugMode() > 0 ) {
            String spaceText = space.getDescription();
            sb.append( spaceText);
            IGoString string = space.getString();
            IGoEye eye = space.getEye();
            if ( string != null ) {
                appendStringText(sb, spaceText, string);
            }
            // it might belong to both an eye and a string
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.