Examples of nextVariant()


Examples of com.sgfj.SGFNodeIterator.nextVariant()

                    SGFMove newMove = new SGFMove(cursorX, cursorY, game.colorToPlay);
                    SGFMove variantMove;
                    i.firstVariant(true);
                    do {
                        variantMove = i.current().getMoveProperty();
                    } while (!newMove.equals(variantMove) && i.nextVariant(true) != null);

                    if (!newMove.equals(variantMove))
                        return false;
                }
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                        do {
                            if ((i.current().bits & SGFNode.GOOD_MOVE) != 0)
                                nGoodVariants++;
                            else if ((i.current().bits & SGFNode.BAD_MOVE) != 0)
                                nBadVariants++;
                        } while (i.nextVariant(true) != null);

                        // play response if there is good/bad hint
                        if (nGoodVariants > 0 || nBadVariants > 0) {
                            int k;
                            int mask;
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                        if (isInView(m))
                            getWit(m).addMark(WIT.VARIANT);
                    } catch (SGFPropertyNotFoundException e) {
                        // DO NOTHING
                    }
            } while (i.nextVariant(true) != null);
        }

        // mark hints
        if (showMoveHints) {
            SGFNodeIterator i = lastMoveNode.iterator();
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                                getWit(m).addMark(WIT.VARIANT);
                        }
                    } catch (SGFPropertyNotFoundException e) {
                        // DO NOTHING
                    }
                } while (i.nextVariant(true) != null);
            }
        }

        if (showMoyo) {
            bmap.setup(game.board);
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                int bits = 0;
                if (nextMoves.next(true) != null) {
                    nextMoves.firstVariant(true);
                    do {
                        bits |= nextMoves.current().bits;
                    } while (nextMoves.nextVariant(true) != null);
                }

                //#ifdef debug
                System.out.println("Next move bits: " + bits);
                //#endif
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                    SGFMove newMove = new SGFMove(cursorX, cursorY, game.colorToPlay);
                    SGFMove variantMove;
                    i.firstVariant(true);
                    do {
                        variantMove = i.current().getMoveProperty();
                    } while (!newMove.equals(variantMove) && i.nextVariant(true) != null);

                    if (!newMove.equals(variantMove))
                        return false;
                }
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                        do {
                            if ((i.current().bits & SGFNode.GOOD_MOVE) != 0)
                                nGoodVariants++;
                            else if ((i.current().bits & SGFNode.BAD_MOVE) != 0)
                                nBadVariants++;
                        } while (i.nextVariant(true) != null);

                        // play response if there is good/bad hint
                        if (nGoodVariants > 0 || nBadVariants > 0) {
                            int k;
                            int mask;
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                case Canvas.KEY_NUM7:
                    {
                        SGFNodeIterator i = game.kifuLastMove().iterator();
                        // skip to node with some variants
                        while (i.prev(true) != null
                                && i.nextVariant(false) == null
                                && i.prevVariant(false) == null)
                            // DO NOTHING
                            ;
                        if (!(i.nextVariant(false) == null && i.prevVariant(false) == null)
                                && i.current() != game.kifuLastMove()) {
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

                        while (i.prev(true) != null
                                && i.nextVariant(false) == null
                                && i.prevVariant(false) == null)
                            // DO NOTHING
                            ;
                        if (!(i.nextVariant(false) == null && i.prevVariant(false) == null)
                                && i.current() != game.kifuLastMove()) {
                            // play game to found node
                            while (i.current() != game.kifuLastMove())
                                game.prev();
                            notify = true;
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

        assertSame(null, iterator.next(true));
        assertSame(n2v1, iterator.prevVariant(true));
        assertSame(null, iterator.prevVariant(true));
        assertSame(n1, iterator.prev(true));
        assertSame(n2v1, iterator.next(true));
        assertSame(n2v2, iterator.nextVariant(true));
        assertSame(null, iterator.nextVariant(true));
    }

    public void testWalk2() {
        SGFNode n1 = new SGFNode();
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.