Search in sources :

Example 16 with ContextImpl

use of org.terasology.engine.context.internal.ContextImpl in project Terasology by MovingBlocks.

the class WorldGeneratorManagerTest method provideContext.

@BeforeEach
void provideContext() throws Exception {
    context = new ContextImpl();
    context.put(ModuleManager.class, ModuleManagerFactory.create());
}
Also used : ContextImpl(org.terasology.engine.context.internal.ContextImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 17 with ContextImpl

use of org.terasology.engine.context.internal.ContextImpl in project Terasology by MovingBlocks.

the class IntMathTest method setUpClass.

@BeforeAll
public static void setUpClass() throws Exception {
    Config config = new Config(new MockContext());
    CoreRegistry.setContext(new ContextImpl());
    CoreRegistry.put(Config.class, config);
}
Also used : MockContext(org.terasology.engine.context.internal.MockContext) Config(org.terasology.engine.config.Config) ContextImpl(org.terasology.engine.context.internal.ContextImpl) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 18 with ContextImpl

use of org.terasology.engine.context.internal.ContextImpl in project Terasology by MovingBlocks.

the class InputSystemTests method setUp.

@BeforeEach
public void setUp() {
    Context context = new ContextImpl();
    setUpLocalPlayer(context);
    setUpDisplayDevice(context);
    setUpBindsManager(context);
    setUpTargetSystem(context);
    context.put(Time.class, new TimeSystem());
    inputSystem = new InputSystem();
    InjectionHelper.inject(inputSystem, context);
    testKeyboard = new TestKeyboard();
    inputSystem.setKeyboardDevice(testKeyboard);
    clientEntityKeyEvents = new ArrayList<>();
    characterEntityKeyEvents = new ArrayList<>();
}
Also used : Context(org.terasology.engine.context.Context) InputSystem(org.terasology.engine.input.InputSystem) ContextImpl(org.terasology.engine.context.internal.ContextImpl) TimeSystem(org.terasology.engine.core.subsystem.headless.device.TimeSystem) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 19 with ContextImpl

use of org.terasology.engine.context.internal.ContextImpl in project Terasology by MovingBlocks.

the class Environment method reset.

protected void reset(Set<Name> moduleNames) throws Exception {
    this.context = new ContextImpl();
    RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = new RecordAndReplayCurrentStatus();
    context.put(RecordAndReplayCurrentStatus.class, recordAndReplayCurrentStatus);
    CoreRegistry.setContext(context);
    setupPathManager();
    Bullet.init(true, false);
    setupConfig();
    setupModuleManager(moduleNames);
    setupDisplay();
    setupAudio();
    AssetManager assetManager = setupAssetManager();
    setupBlockManager(assetManager);
    setupExtraDataManager(context);
    setupCollisionManager();
    setupNetwork();
    setupEntitySystem();
    setupStorageManager();
    setupComponentManager();
    setupWorldProvider();
    setupCelestialSystem();
    loadPrefabs();
}
Also used : AssetManager(org.terasology.gestalt.assets.management.AssetManager) RecordAndReplayCurrentStatus(org.terasology.engine.recording.RecordAndReplayCurrentStatus) ContextImpl(org.terasology.engine.context.internal.ContextImpl)

Example 20 with ContextImpl

use of org.terasology.engine.context.internal.ContextImpl in project Terasology by MovingBlocks.

the class BindsSubsystemTest method setUp.

@BeforeEach
public void setUp() {
    bindsSubsystem = new BindsSubsystem();
    bindsConfiguration = new BindsConfigAdapter(new BindsConfig());
    context = new ContextImpl();
    context.put(BindsConfiguration.class, bindsConfiguration);
    bindsSubsystem.preInitialise(context);
    setUpMockModuleEnvironment();
}
Also used : BindsConfigAdapter(org.terasology.engine.core.subsystem.config.BindsSubsystem.BindsConfigAdapter) BindsConfig(org.terasology.engine.config.BindsConfig) ContextImpl(org.terasology.engine.context.internal.ContextImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ContextImpl (org.terasology.engine.context.internal.ContextImpl)26 BeforeEach (org.junit.jupiter.api.BeforeEach)13 ModuleManager (org.terasology.engine.core.module.ModuleManager)8 RecordAndReplayCurrentStatus (org.terasology.engine.recording.RecordAndReplayCurrentStatus)8 Context (org.terasology.engine.context.Context)7 ModuleAwareAssetTypeManager (org.terasology.gestalt.assets.module.ModuleAwareAssetTypeManager)7 PojoPrefab (org.terasology.engine.entitySystem.prefab.internal.PojoPrefab)6 ModuleAwareAssetTypeManagerImpl (org.terasology.gestalt.assets.module.ModuleAwareAssetTypeManagerImpl)6 BeforeAll (org.junit.jupiter.api.BeforeAll)5 Test (org.junit.jupiter.api.Test)4 PojoPrefabManager (org.terasology.engine.entitySystem.prefab.internal.PojoPrefabManager)4 NetworkSystem (org.terasology.engine.network.NetworkSystem)4 TypeHandlerLibrary (org.terasology.persistence.typeHandling.TypeHandlerLibrary)4 Reflections (org.reflections.Reflections)3 ComponentLibrary (org.terasology.engine.entitySystem.metadata.ComponentLibrary)3 EntitySystemLibrary (org.terasology.engine.entitySystem.metadata.EntitySystemLibrary)3 TypeHandlerLibraryImpl (org.terasology.engine.persistence.typeHandling.TypeHandlerLibraryImpl)3 Config (org.terasology.engine.config.Config)2 EnvironmentSwitchHandler (org.terasology.engine.core.bootstrap.EnvironmentSwitchHandler)2 EngineEntityManager (org.terasology.engine.entitySystem.entity.internal.EngineEntityManager)2