Package com.sgfj

Examples of com.sgfj.SGFNodeIterator.nextVariant()


        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();
        SGFNode n2v1 = new SGFNode();
View Full Code Here


        n1.add(n2v2);
        n2v1.add(n3);

        SGFNodeIterator it = n1.iterator();
        assertSame(n2v1, it.next(true));
        assertSame(n2v2, it.nextVariant(true));
        assertSame(n2v1, it.prevVariant(true));
        assertSame(n3, it.next(true));
    }
}
View Full Code Here

                case Canvas.KEY_NUM9:
                    {
                        SGFNodeIterator i = game.kifuLastMove().iterator();
                        // skip to node with some variants
                        while (i.next(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

                        while (i.next(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.next();
                            notify = true;
View Full Code Here

                        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

                                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

                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

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.