use of org.terasology.engine.logic.console.ConsoleImpl in project Terasology by MovingBlocks.
the class AbstractState method initEntityAndComponentManagers.
protected void initEntityAndComponentManagers(boolean isHeadless) {
verifyNotNull(context);
CoreRegistry.setContext(context);
// let's get the entity event system running
EntitySystemSetupUtil.addEntityManagementRelatedClasses(context);
entityManager = context.get(EngineEntityManager.class);
eventSystem = context.get(EventSystem.class);
context.put(Console.class, new ConsoleImpl(context));
if (!isHeadless) {
NUIManager nuiManager = new NUIManagerInternal((TerasologyCanvasRenderer) context.get(CanvasRenderer.class), context);
context.put(NUIManager.class, nuiManager);
}
componentSystemManager = new ComponentSystemManager(context);
context.put(ComponentSystemManager.class, componentSystemManager);
componentSystemManager.register(new ConsoleSystem(), "engine:ConsoleSystem");
componentSystemManager.register(new CoreCommands(), "engine:CoreCommands");
}
use of org.terasology.engine.logic.console.ConsoleImpl in project Terasology by MovingBlocks.
the class TerasologyTestingEnvironment method setup.
@BeforeEach
public void setup() throws Exception {
context.put(ModuleManager.class, moduleManager);
RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = context.get(RecordAndReplayCurrentStatus.class);
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);
ExtraBlockDataManager extraDataManager = context.get(ExtraBlockDataManager.class);
RecordedEventStore recordedEventStore = new RecordedEventStore();
RecordAndReplayUtils recordAndReplayUtils = new RecordAndReplayUtils();
context.put(RecordAndReplayUtils.class, recordAndReplayUtils);
CharacterStateEventPositionMap characterStateEventPositionMap = new CharacterStateEventPositionMap();
context.put(CharacterStateEventPositionMap.class, characterStateEventPositionMap);
DirectionAndOriginPosRecorderList directionAndOriginPosRecorderList = new DirectionAndOriginPosRecorderList();
context.put(DirectionAndOriginPosRecorderList.class, directionAndOriginPosRecorderList);
RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(engineEntityManager, recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap, directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));
context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer);
Path savePath = PathManager.getInstance().getSavePath("world1");
context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(), engineEntityManager, mockBlockManager, extraDataManager, recordAndReplaySerializer, recordAndReplayUtils, recordAndReplayCurrentStatus));
ComponentSystemManager 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