Examples of nextVariant()


Examples of com.sgfj.SGFNodeIterator.nextVariant()

            move = (SGFPointProperty) i.current().getProperty(SGFPropertyName.B);
            assertEquals(new SGFPointProperty(SGFPropertyName.B, new SGFPoint(4, 6)), move);
            assertFalse(i.current().hasProperty(SGFPropertyName.W));
            //assertSame(p.getParent(), tree);
            //assertSame(p.next(), null);
            assertNull(i.nextVariant(false));
            //assertNotSame(p.getNext(), null);

        } catch (Exception e) {
            e.printStackTrace();
            fail("No exceptions are expected.");
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            SGFNodeIterator i = tree.iterator();
            SGFNode node = i.current();
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(false);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            SGFNodeIterator i = tree.iterator();
            SGFNode node;
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(false);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(false);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.nextVariant(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);

        } catch (Exception e) {
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.next(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) != 0 && (node.bits & SGFNode.BAD_MOVE) == 0);
            node = i.nextVariant(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);
            node = i.nextVariant(true);
            assertTrue((node.bits & SGFNode.GOOD_MOVE) == 0 && (node.bits & SGFNode.BAD_MOVE) != 0);

        } catch (Exception e) {
            e.printStackTrace();
            fail("No exceptions are expected.");
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

        root.iterator().next(false).play(m2);
        SGFNodeIterator it = root.iterator();
        try {
            assertEquals(m1, it.next(true).getMoveProperty());
            assertEquals(m2, it.next(true).getMoveProperty());
            assertEquals(m3, it.nextVariant(true).getMoveProperty());
            assertEquals(null, it.nextVariant(true));
        } catch (SGFPropertyNotFoundException e) {
            e.printStackTrace();
            fail("Unexpected!");
        }
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

        SGFNodeIterator it = root.iterator();
        try {
            assertEquals(m1, it.next(true).getMoveProperty());
            assertEquals(m2, it.next(true).getMoveProperty());
            assertEquals(m3, it.nextVariant(true).getMoveProperty());
            assertEquals(null, it.nextVariant(true));
        } catch (SGFPropertyNotFoundException e) {
            e.printStackTrace();
            fail("Unexpected!");
        }
    }
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            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);
            assertEquals(new SGFPointProperty(SGFPropertyName.W, new SGFPoint(4, 3)), move);
            assertFalse(i.current().hasProperty(SGFPropertyName.B));
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            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);
            assertEquals(move, new SGFPointProperty(SGFPropertyName.B, new SGFPoint(4, 2)));
            assertFalse(i.current().hasProperty(SGFPropertyName.W));
View Full Code Here

Examples of com.sgfj.SGFNodeIterator.nextVariant()

            do {
                SGFNode node = i.current();
                if ((node.bits & SGFNode.GOOD_MOVE) != 0) {
                    return setCursor(node);
                }
            } while (i.nextVariant(true) != null);
            // no good moves found, set cursor to any move
            return setCursor(i.current());
        }
        return false;
    }
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.