Package org.terasology.logic.behavior.asset

Examples of org.terasology.logic.behavior.asset.BehaviorTreeLoader.load()


        BehaviorTreeLoader loader = new BehaviorTreeLoader();
        ByteArrayOutputStream os = new ByteArrayOutputStream(10000);

        try {
            loader.save(os, data);
            BehaviorTreeData copy = loader.load(null, new ByteArrayInputStream(os.toByteArray()), null, Collections.<URL>emptyList());
            Port.OutputPort parent = node.getInputPort().getTargetPort();
            copy.createRenderable();
            RenderableNode copyRenderable = copy.getRenderableNode(copy.getRoot());
            addNode(copyRenderable);
            RenderableNode nodeToLayout;
View Full Code Here


        BehaviorTreeData data = buildSample();

        OutputStream os = new ByteArrayOutputStream(10000);
        loader.save(os, data);
        String jsonExpected = os.toString();
        data = loader.load(null, new ByteArrayInputStream(jsonExpected.getBytes()), null, null);
        os = new ByteArrayOutputStream(10000);
        loader = new BehaviorTreeLoader();
        loader.save(os, data);
        String jsonActual = os.toString();
        Assert.assertEquals(jsonActual, jsonExpected);
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.