Package com.sgfj

Examples of com.sgfj.SGFPointProperty


            //FileInputStream is = new FileInputStream("data/1850-11-17-Shusaku-Ito.Showa.sgf");
            SGFNode tree = reader.parse();
            assertNotNull("Emty tree received.", tree);

            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);
            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));
            //assertSame(p.getParent(), tree);
            assertNull(null, i.next(false));
            assertNull(null, i.prevVariant(false));
            //assertNotSame(p.getNext(), null);

            i.nextVariant(true);
            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);
View Full Code Here


    }

    public void testGetProperty2() {
        try {
            SGFNode node = new SGFNode();
            SGFPointProperty pprop = new SGFPointProperty(SGFPropertyName.W, new SGFPoint(1, 2));
            node.addPropertyNoCheck(pprop);
            assertEquals(pprop, node.getProperty(SGFPropertyName.W));

            SGFIntProperty iprop = new SGFIntProperty(SGFPropertyName.SZ, 19);
            node.addPropertyNoCheck(iprop);
View Full Code Here

                SGFPropertyName name;
                if (color == Board.WHITE)
                    name = SGFPropertyName.AW;
                else
                    name = SGFPropertyName.AB;
                head.addProperty(new SGFPointProperty(name, board.xy(pos)));
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sgfj.SGFPointProperty

Copyright © 2018 www.massapicom. 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.