Search in sources :

Example 6 with ComponentSystem

use of org.terasology.engine.entitySystem.systems.ComponentSystem in project Terasology by MovingBlocks.

the class ComponentSystemManager method initialise.

public void initialise() {
    if (!initialised) {
        console = context.get(Console.class);
        for (ComponentSystem system : getAllSystems()) {
            initialiseSystem(system);
        }
        initialised = true;
    } else {
        logger.error("ComponentSystemManager got initialized twice");
    }
}
Also used : Console(org.terasology.engine.logic.console.Console) ComponentSystem(org.terasology.engine.entitySystem.systems.ComponentSystem)

Example 7 with ComponentSystem

use of org.terasology.engine.entitySystem.systems.ComponentSystem in project Terasology by MovingBlocks.

the class PostBeginSystems method begin.

@Override
public void begin() {
    ComponentSystemManager manager = context.get(ComponentSystemManager.class);
    final List<ComponentSystem> componentSystemList = manager.getAllSystems();
    componentSystems = componentSystemList.iterator();
    setTotalSteps(componentSystemList.size());
}
Also used : ComponentSystem(org.terasology.engine.entitySystem.systems.ComponentSystem) ComponentSystemManager(org.terasology.engine.core.ComponentSystemManager)

Example 8 with ComponentSystem

use of org.terasology.engine.entitySystem.systems.ComponentSystem 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

ComponentSystem (org.terasology.engine.entitySystem.systems.ComponentSystem)8 ComponentSystemManager (org.terasology.engine.core.ComponentSystemManager)4 DisplayDevice (org.terasology.engine.core.subsystem.DisplayDevice)1 RegisterSystem (org.terasology.engine.entitySystem.systems.RegisterSystem)1 Console (org.terasology.engine.logic.console.Console)1 Module (org.terasology.gestalt.module.Module)1 Name (org.terasology.gestalt.naming.Name)1