Package org.terasology.entitySystem.prefab

Examples of org.terasology.entitySystem.prefab.PrefabData.addComponent()


        entityManager.getComponentLibrary().register(new SimpleUri("test", "integer"), IntegerComponent.class);
        entitySerializer = new EntitySerializer(entityManager);
        componentLibrary = entityManager.getComponentLibrary();

        PrefabData prefabData = new PrefabData();
        prefabData.addComponent(new StringComponent("Value"));
        prefab = Assets.generateAsset(new AssetUri(AssetType.PREFAB, "test:Test"), prefabData, Prefab.class);
    }

    @Test
    public void testDeltaNoUnchangedComponents() throws Exception {
View Full Code Here


        plainBlock = new Block();
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:plainBlock"), plainBlock), true);

        blockWithString = new Block();
        PrefabData prefabData = new PrefabData();
        prefabData.addComponent(new StringComponent("Test"));
        Assets.generateAsset(new AssetUri(AssetType.PREFAB, "test:prefabWithString"), prefabData, Prefab.class);
        blockWithString.setPrefab("test:prefabWithString");
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:blockWithString"), blockWithString), true);

        blockWithDifferentString = new Block();
View Full Code Here

        blockWithString.setPrefab("test:prefabWithString");
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:blockWithString"), blockWithString), true);

        blockWithDifferentString = new Block();
        prefabData = new PrefabData();
        prefabData.addComponent(new StringComponent("Test2"));
        Assets.generateAsset(
                new AssetUri(AssetType.PREFAB, "test:prefabWithDifferentString"), prefabData, Prefab.class);
        blockWithDifferentString.setPrefab("test:prefabWithDifferentString");
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:blockWithDifferentString"), blockWithDifferentString), true);
View Full Code Here

        blockWithDifferentString.setPrefab("test:prefabWithDifferentString");
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:blockWithDifferentString"), blockWithDifferentString), true);

        blockWithRetainedComponent = new Block();
        prefabData = new PrefabData();
        prefabData.addComponent(new RetainedOnBlockChangeComponent(3));
        Assets.generateAsset(
                new AssetUri(AssetType.PREFAB, "test:prefabWithRetainedComponent"), prefabData, Prefab.class);
        blockWithRetainedComponent.setPrefab("test:prefabWithRetainedComponent");
        blockManager.addBlockFamily(new SymmetricFamily(new BlockUri("test:blockWithRetainedComponent"), blockWithRetainedComponent), true);
View Full Code Here

        EntitySystemBuilder builder = new EntitySystemBuilder();

        entityManager = (PojoEntityManager) builder.build(moduleManager.getEnvironment(), mock(NetworkSystem.class), new ReflectionReflectFactory());

        PrefabData protoPrefab = new PrefabData();
        protoPrefab.addComponent(new StringComponent("Test"));
        prefab = Assets.generateAsset(new AssetUri(AssetType.PREFAB, "unittest:myprefab"), protoPrefab, Prefab.class);
    }

    @Test
    public void createEntity() {
View Full Code Here

    }

    @Test
    public void retrievePrefab() {
        PrefabData data = new PrefabData();
        data.addComponent(new StringComponent("Test"));
        Prefab prefab = Assets.generateAsset(new AssetUri(AssetType.PREFAB, PREFAB_NAME), data, Prefab.class);
        Prefab ref = prefabManager.getPrefab(PREFAB_NAME);
        assertNotNull(ref);
        assertEquals(PREFAB_NAME, ref.getName());
    }
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.