Search in sources :

Example 11 with ComponentSystemManager

use of org.terasology.engine.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.subsystem.EngineSubsystem) GameEngine(org.terasology.engine.GameEngine) ModuleManager(org.terasology.engine.module.ModuleManager) TerasologyEngine(org.terasology.engine.TerasologyEngine) ComponentSystemManager(org.terasology.engine.ComponentSystemManager)

Example 12 with ComponentSystemManager

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

the class HeadlessEnvironment method setupComponentManager.

@Override
protected void setupComponentManager() {
    ComponentSystemManager componentSystemManager = new ComponentSystemManager(context);
    componentSystemManager.initialise();
    context.put(ComponentSystemManager.class, componentSystemManager);
}
Also used : ComponentSystemManager(org.terasology.engine.ComponentSystemManager)

Example 13 with ComponentSystemManager

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

the class TerasologyTestingEnvironment method setup.

@Before
public void setup() throws Exception {
    context.put(ModuleManager.class, moduleManager);
    mockTime = mock(EngineTime.class);
    context.put(Time.class, mockTime);
    NetworkSystemImpl networkSystem = new NetworkSystemImpl(mockTime, context);
    context.put(Game.class, new Game());
    context.put(NetworkSystem.class, networkSystem);
    EntitySystemSetupUtil.addReflectionBasedLibraries(context);
    EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
    engineEntityManager = context.get(EngineEntityManager.class);
    // 'mock' added to avoid hiding a field
    BlockManager mockBlockManager = context.get(BlockManager.class);
    BiomeManager biomeManager = context.get(BiomeManager.class);
    Path savePath = PathManager.getInstance().getSavePath("world1");
    context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(), engineEntityManager, mockBlockManager, biomeManager));
    componentSystemManager = new ComponentSystemManager(context);
    context.put(ComponentSystemManager.class, componentSystemManager);
    LoadPrefabs prefabLoadStep = new LoadPrefabs(context);
    boolean complete = false;
    prefabLoadStep.begin();
    while (!complete) {
        complete = prefabLoadStep.step();
    }
    context.get(ComponentSystemManager.class).initialise();
    context.put(Console.class, new ConsoleImpl(context));
}
Also used : EngineEntityManager(org.terasology.entitySystem.entity.internal.EngineEntityManager) BiomeManager(org.terasology.world.biomes.BiomeManager) Path(java.nio.file.Path) Game(org.terasology.game.Game) LoadPrefabs(org.terasology.engine.modes.loadProcesses.LoadPrefabs) ConsoleImpl(org.terasology.logic.console.ConsoleImpl) BlockManager(org.terasology.world.block.BlockManager) EngineTime(org.terasology.engine.EngineTime) ReadWriteStorageManager(org.terasology.persistence.internal.ReadWriteStorageManager) NetworkSystemImpl(org.terasology.network.internal.NetworkSystemImpl) ComponentSystemManager(org.terasology.engine.ComponentSystemManager) Before(org.junit.Before)

Aggregations

ComponentSystemManager (org.terasology.engine.ComponentSystemManager)13 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)4 InputSystem (org.terasology.input.InputSystem)3 ConsoleImpl (org.terasology.logic.console.ConsoleImpl)3 LocalPlayer (org.terasology.logic.players.LocalPlayer)3 ClientComponent (org.terasology.network.ClientComponent)3 Before (org.junit.Before)2 EngineTime (org.terasology.engine.EngineTime)2 ModuleManager (org.terasology.engine.module.ModuleManager)2 EntityRef (org.terasology.entitySystem.entity.EntityRef)2 EventSystem (org.terasology.entitySystem.event.internal.EventSystem)2 EventLibrary (org.terasology.entitySystem.metadata.EventLibrary)2 ComponentSystem (org.terasology.entitySystem.systems.ComponentSystem)2 CameraTargetSystem (org.terasology.input.cameraTarget.CameraTargetSystem)2 ConsoleSystem (org.terasology.logic.console.ConsoleSystem)2 CoreCommands (org.terasology.logic.console.commands.CoreCommands)2 NUIManager (org.terasology.rendering.nui.NUIManager)2 NUIManagerInternal (org.terasology.rendering.nui.internal.NUIManagerInternal)2 BlockEntityRegistry (org.terasology.world.BlockEntityRegistry)2 Path (java.nio.file.Path)1