Package org.terasology.entitySystem.metadata

Examples of org.terasology.entitySystem.metadata.EntitySystemLibrary


        // 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


    public void setup() {
        ReflectFactory reflectFactory = new ReflectionReflectFactory();
        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);
        entityManager.setEventSystem(eventSystem);
        entity = entityManager.create();
    }
View Full Code Here

        ReflectFactory reflectFactory = new ReflectionReflectFactory();
        CopyStrategyLibrary copyStrategyLibrary = new CopyStrategyLibrary(reflectFactory);
        TypeSerializationLibrary lib = new TypeSerializationLibrary(reflectFactory, copyStrategyLibrary);
        lib.add(Vector3f.class, new Vector3fTypeHandler());
        lib.add(Quat4f.class, new Quat4fTypeHandler());
        entitySystemLibrary = new EntitySystemLibrary(reflectFactory, copyStrategyLibrary, lib);
        componentLibrary = entitySystemLibrary.getComponentLibrary();
        prefabManager = new PojoPrefabManager();
        AssetManager assetManager = new AssetManager(moduleManager.getEnvironment());
        assetManager.setAssetFactory(AssetType.PREFAB, new AssetFactory<PrefabData, Prefab>() {
            @Override
View Full Code Here

    }

    @Override
    public boolean step() {
        EngineEntityManager entityManager = (EngineEntityManager) CoreRegistry.get(EntityManager.class);
        EntitySystemLibrary entitySystemLibrary = CoreRegistry.get(EntitySystemLibrary.class);
        BlockEntityRegistry blockEntityRegistry = CoreRegistry.get(BlockEntityRegistry.class);

        CoreRegistry.get(NetworkSystem.class).connectToEntitySystem(entityManager, entitySystemLibrary, blockEntityRegistry);
        ComponentSystemManager csm = CoreRegistry.get(ComponentSystemManager.class);
        csm.initialise();
View Full Code Here

TOP

Related Classes of org.terasology.entitySystem.metadata.EntitySystemLibrary

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.