Examples of PojoEntityManager


Examples of org.terasology.entitySystem.entity.internal.PojoEntityManager

        return build(environment, networkSystem, reflectFactory, new CopyStrategyLibrary(reflectFactory));
    }

    public EngineEntityManager build(ModuleEnvironment environment, NetworkSystem networkSystem, ReflectFactory reflectFactory, CopyStrategyLibrary copyStrategyLibrary) {
        // Entity Manager
        PojoEntityManager entityManager = CoreRegistry.put(EntityManager.class, new PojoEntityManager());
        CoreRegistry.put(EngineEntityManager.class, entityManager);

        // Standard serialization library
        TypeSerializationLibrary typeSerializationLibrary = buildTypeLibrary(entityManager, reflectFactory, copyStrategyLibrary);
        entityManager.setTypeSerializerLibrary(typeSerializationLibrary);

        // Entity System Library
        EntitySystemLibrary library = CoreRegistry.put(EntitySystemLibrary.class, new EntitySystemLibrary(reflectFactory, copyStrategyLibrary, typeSerializationLibrary));
        entityManager.setEntitySystemLibrary(library);
        CoreRegistry.put(ComponentLibrary.class, library.getComponentLibrary());
        CoreRegistry.put(EventLibrary.class, library.getEventLibrary());

        // Prefab Manager
        PrefabManager prefabManager = new PojoPrefabManager();
        entityManager.setPrefabManager(prefabManager);
        CoreRegistry.put(PrefabManager.class, prefabManager);

        // Event System
        EventSystem eventSystem = new EventSystemImpl(library.getEventLibrary(), networkSystem);
        entityManager.setEventSystem(eventSystem);
        CoreRegistry.put(EventSystem.class, eventSystem);

        // TODO: Review - NodeClassLibrary related to the UI for behaviours. Should not be here and probably not even in the CoreRegistry
        CoreRegistry.put(OneOfProviderFactory.class, new OneOfProviderFactory());

        // Behaviour Trees Node Library
        NodesClassLibrary nodesClassLibrary = new NodesClassLibrary(reflectFactory, copyStrategyLibrary);
        CoreRegistry.put(NodesClassLibrary.class, nodesClassLibrary);
        nodesClassLibrary.scan(environment);

        registerComponents(library.getComponentLibrary(), environment);
        registerEvents(entityManager.getEventSystem(), environment);
        return entityManager;
    }
View Full Code Here

Examples of org.terasology.entitySystem.entity.internal.PojoEntityManager

        CopyStrategyLibrary copyStrategies = new CopyStrategyLibrary(reflectFactory);
        TypeSerializationLibrary serializationLibrary = new TypeSerializationLibrary(reflectFactory, copyStrategies);

        EntitySystemLibrary entitySystemLibrary = new EntitySystemLibrary(reflectFactory, copyStrategies, serializationLibrary);
        compLibrary = entitySystemLibrary.getComponentLibrary();
        entityManager = new PojoEntityManager();
        entityManager.setEntitySystemLibrary(entitySystemLibrary);
        entityManager.setPrefabManager(new PojoPrefabManager());
        NetworkSystem networkSystem = mock(NetworkSystem.class);
        when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
        eventSystem = new EventSystemImpl(entitySystemLibrary.getEventLibrary(), networkSystem);
View Full Code Here

Examples of org.terasology.entitySystem.entity.internal.PojoEntityManager

                entityData.add(new BlockComponent());
            }
            rawEntityData.add(entityData);
        }

        entityManager = new PojoEntityManager();
        for (List<Component> rawEntity : rawEntityData) {
            entityManager.create(rawEntity);
        }
    }
View Full Code Here

Examples of org.terasology.entitySystem.entity.internal.PojoEntityManager

        }
    }

    @Override
    public void run() {
        PojoEntityManager entityManager = new PojoEntityManager();
        for (List<Component> rawEntity : rawEntityData) {
            entityManager.create(rawEntity);
        }
    }
View Full Code Here

Examples of org.terasology.entitySystem.entity.internal.PojoEntityManager

                entityData.add(new BlockComponent());
            }
            rawEntityData.add(entityData);
        }

        entityManager = new PojoEntityManager();
        for (List<Component> rawEntity : rawEntityData) {
            entityManager.create(rawEntity);
        }
    }
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.