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;
}
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);
}
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));
}
Aggregations