Search in sources :

Example 11 with ComponentSystemManager

use of org.terasology.engine.core.ComponentSystemManager in project Terasology by MovingBlocks.

the class RegisterSystems method step.

@Override
public boolean step() {
    componentSystemManager = context.get(ComponentSystemManager.class);
    ModuleManager moduleManager = context.get(ModuleManager.class);
    TerasologyEngine terasologyEngine = (TerasologyEngine) context.get(GameEngine.class);
    for (EngineSubsystem subsystem : terasologyEngine.getSubsystems()) {
        subsystem.registerSystems(componentSystemManager);
    }
    componentSystemManager.loadSystems(moduleManager.getEnvironment(), netMode);
    return true;
}
Also used : EngineSubsystem(org.terasology.engine.core.subsystem.EngineSubsystem) GameEngine(org.terasology.engine.core.GameEngine) ModuleManager(org.terasology.engine.core.module.ModuleManager) TerasologyEngine(org.terasology.engine.core.TerasologyEngine) ComponentSystemManager(org.terasology.engine.core.ComponentSystemManager)

Example 12 with ComponentSystemManager

use of org.terasology.engine.core.ComponentSystemManager in project Terasology by MovingBlocks.

the class InitialiseSystems method step.

@Override
public boolean step() {
    EngineEntityManager entityManager = (EngineEntityManager) context.get(EntityManager.class);
    EventLibrary eventLibrary = context.get(EventLibrary.class);
    BlockEntityRegistry blockEntityRegistry = context.get(BlockEntityRegistry.class);
    context.get(NetworkSystem.class).connectToEntitySystem(entityManager, eventLibrary, blockEntityRegistry);
    ComponentSystemManager csm = context.get(ComponentSystemManager.class);
    csm.initialise();
    return true;
}
Also used : EngineEntityManager(org.terasology.engine.entitySystem.entity.internal.EngineEntityManager) EngineEntityManager(org.terasology.engine.entitySystem.entity.internal.EngineEntityManager) EntityManager(org.terasology.engine.entitySystem.entity.EntityManager) EventLibrary(org.terasology.engine.entitySystem.metadata.EventLibrary) NetworkSystem(org.terasology.engine.network.NetworkSystem) BlockEntityRegistry(org.terasology.engine.world.BlockEntityRegistry) ComponentSystemManager(org.terasology.engine.core.ComponentSystemManager)

Example 13 with ComponentSystemManager

use of org.terasology.engine.core.ComponentSystemManager in project Terasology by MovingBlocks.

the class ReadWriteStorageManager method startAutoSaving.

private void startAutoSaving() {
    logger.info("Auto Saving - Creating game snapshot");
    PerformanceMonitor.startActivity("Auto Saving");
    ComponentSystemManager componentSystemManager = CoreRegistry.get(ComponentSystemManager.class);
    for (ComponentSystem sys : componentSystemManager.getAllSystems()) {
        sys.preAutoSave();
    }
    saveTransaction = createSaveTransaction();
    saveThreadManager.offer(saveTransaction);
    for (ComponentSystem sys : componentSystemManager.getAllSystems()) {
        sys.postAutoSave();
    }
    scheduleNextAutoSave();
    PerformanceMonitor.endActivity();
    entitySetDeltaRecorder = new EntitySetDeltaRecorder(this.entityRefReplacingComponentLibrary);
    logger.info("Auto Saving - Snapshot created: Writing phase starts");
}
Also used : ComponentSystem(org.terasology.engine.entitySystem.systems.ComponentSystem) ComponentSystemManager(org.terasology.engine.core.ComponentSystemManager)

Aggregations

ComponentSystemManager (org.terasology.engine.core.ComponentSystemManager)13 ComponentSystem (org.terasology.engine.entitySystem.systems.ComponentSystem)4 BeforeEach (org.junit.jupiter.api.BeforeEach)3 EngineEntityManager (org.terasology.engine.entitySystem.entity.internal.EngineEntityManager)3 EngineTime (org.terasology.engine.core.EngineTime)2 ModuleManager (org.terasology.engine.core.module.ModuleManager)2 EntityManager (org.terasology.engine.entitySystem.entity.EntityManager)2 EventSystem (org.terasology.engine.entitySystem.event.internal.EventSystem)2 EventLibrary (org.terasology.engine.entitySystem.metadata.EventLibrary)2 ConsoleImpl (org.terasology.engine.logic.console.ConsoleImpl)2 BlockEntityRegistry (org.terasology.engine.world.BlockEntityRegistry)2 Path (java.nio.file.Path)1 Context (org.terasology.engine.context.Context)1 GameEngine (org.terasology.engine.core.GameEngine)1 TerasologyEngine (org.terasology.engine.core.TerasologyEngine)1 LoadPrefabs (org.terasology.engine.core.modes.loadProcesses.LoadPrefabs)1 EngineSubsystem (org.terasology.engine.core.subsystem.EngineSubsystem)1 UpdateSubscriberSystem (org.terasology.engine.entitySystem.systems.UpdateSubscriberSystem)1 Game (org.terasology.engine.game.Game)1 InputSystem (org.terasology.engine.input.InputSystem)1