Package com.sgfj

Examples of com.sgfj.SGFIntProperty


            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);
            assertEquals(iprop, node.getProperty(SGFPropertyName.SZ));
        } catch (Exception e) {
            e.printStackTrace();
            fail("No exceptions are expected.");
View Full Code Here


    }

    public void testWriteSynth() {
        try {
            SGFNode root = new SGFNode();
            root.addProperty(new SGFIntProperty(SGFPropertyName.SZ, 9));
            root.addProperty(new SGFIntProperty(SGFPropertyName.HA, 0));

            SGFNode n;
            String s;

            n = new SGFNode();
View Full Code Here

    /**
     * Test method for {@link sgfj.SGFIntProperty#equals(java.lang.Object)}.
     */
    public void testEqualsObject() {
        SGFIntProperty p1 = new SGFIntProperty(SGFPropertyName.SZ, 1);
        SGFIntProperty p2 = new SGFIntProperty(SGFPropertyName.SZ, 1);
        assertEquals(p1, p2);
        p2 = new SGFIntProperty(SGFPropertyName.SZ, 2);
        assertFalse(p1.equals(p2));
        p2 = new SGFIntProperty(SGFPropertyName.HA, 1);
        assertFalse(p1.equals(p2));
    }
View Full Code Here

    /**
     * Test method for {@link sgfj.SGFIntProperty#getInt()}.
     */
    public void testGetInt() {
        SGFIntProperty p1 = new SGFIntProperty(SGFPropertyName.SZ, 1);
        assertEquals(1, p1.getInt());
    }
View Full Code Here

    /**
     * Test method for {@link sgfj.SGFProperty#getText()}.
     */
    public void testGetText() {
        SGFIntProperty p1 = new SGFIntProperty(SGFPropertyName.SZ, 1);
        try {
            p1.getText();
            fail("Should generate SGFInvalidDataRequestException.");
        } catch (SGFInvalidDataRequestException e) {
        }
    }
View Full Code Here

    }

    public void testWriteSynth() {
        try {
            SGFNode root = new SGFNode();
            root.addProperty(new SGFIntProperty(SGFPropertyName.SZ, 9));
            root.addProperty(new SGFIntProperty(SGFPropertyName.HA, 0));

            SGFNode n;
            String s;

            n = new SGFNode();
View Full Code Here

    }

    public void init(int size) {
        super.init(size);
        SGFNode head = new SGFNode();
        head.addProperty(new SGFIntProperty(SGFPropertyName.GM, 1));
        head.addProperty(new SGFIntProperty(SGFPropertyName.FF, 4));
        head.addProperty(new SGFTextProperty(SGFPropertyName.CA, charset.toCharArray()));
        head.addProperty(new SGFTextProperty(SGFPropertyName.AP, application.toCharArray()));
        head.addProperty(new SGFIntProperty(SGFPropertyName.SZ, size));
        kifu = head.iterator();
    }
View Full Code Here

    public void setHandicap(int handicap) {
        super.setHandicap(handicap);

        SGFNode head = kifu.first(false);
        head.addProperty(new SGFIntProperty(SGFPropertyName.HA, handicap));

        for (int pos = 0; pos < board.maxPos(); pos ++) {
            byte color = board.get(pos);
            if (color != Board.NONE) {
                SGFPropertyName name;
View Full Code Here

TOP

Related Classes of com.sgfj.SGFIntProperty

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.