Examples of prev()


Examples of com.sgfj.SGFNodeIterator.prev()

                    break;
                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)
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

            SGFNodeIterator i = tree.iterator();
            SGFPointProperty move;

            assertFalse(i.current().hasProperty(SGFPropertyName.W));
            assertFalse(i.current().hasProperty(SGFPropertyName.B));
            assertNull(i.prev(false));
            assertNull(i.prevVariant(false));
            assertNull(i.nextVariant(false));

            i.next(true);
            move = (SGFPointProperty) i.current().getProperty(SGFPropertyName.W);
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

            i.next(true);
            move = (SGFPointProperty) i.current().getProperty(SGFPropertyName.W);
            assertEquals(new SGFPointProperty(SGFPropertyName.W, new SGFPoint(4, 3)), move);
            assertFalse(i.current().hasProperty(SGFPropertyName.B));
            assertSame(tree, i.prev(false));
            assertNull(i.prevVariant(false));
            assertNull(i.nextVariant(false));

            i.next(true);
            move = (SGFPointProperty) i.current().getProperty(SGFPropertyName.B);
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

     * @throws GameException
     */
    public DocumentedGame(SGFNode current) throws SGFInvalidDataRequestException, SGFPropertyNotFoundException, GameException {
        Stack moves = new Stack();
        SGFNodeIterator ni = current.iterator();
        while (ni.prev(false) != null) {
            moves.push(ni.current());
            ni.prev(true);
        }

        SGFNode head = ni.current();
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

    public DocumentedGame(SGFNode current) throws SGFInvalidDataRequestException, SGFPropertyNotFoundException, GameException {
        Stack moves = new Stack();
        SGFNodeIterator ni = current.iterator();
        while (ni.prev(false) != null) {
            moves.push(ni.current());
            ni.prev(true);
        }

        SGFNode head = ni.current();
        kifu = current.iterator();
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

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

        SGFNodeIterator iterator = n2v2.iterator();
        assertSame(n2v2, iterator.current());
        assertSame(n1, iterator.prev(true));
        assertSame(null, iterator.prev(true));
        assertSame(n2v2, iterator.next(true));
        assertSame(null, iterator.next(true));
        assertSame(n2v1, iterator.prevVariant(true));
        assertSame(null, iterator.prevVariant(true));
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

        n1.add(n2v2);

        SGFNodeIterator iterator = n2v2.iterator();
        assertSame(n2v2, iterator.current());
        assertSame(n1, iterator.prev(true));
        assertSame(null, iterator.prev(true));
        assertSame(n2v2, iterator.next(true));
        assertSame(null, iterator.next(true));
        assertSame(n2v1, iterator.prevVariant(true));
        assertSame(null, iterator.prevVariant(true));
        assertSame(n1, iterator.prev(true));
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

                    break;
                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)
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.prev()

        assertSame(null, iterator.prev(true));
        assertSame(n2v2, iterator.next(true));
        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));
    }
View Full Code Here

Examples of com.tinygo.logic.DocumentedGame.prev()

    public void testNavigation() {
        DocumentedGame game = new DocumentedGame(4);
        Board board = game.board;
        try {
            assertFalse(game.prev());
            assertFalse(game.next());

            SGFNode n2w, n3b_1, n3b_2;
            // test forward/backward navigation
            game.play(3, 3, Board.BLACK);
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.