Search in sources :

Example 21 with ContextImpl

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

the class InputSystemTests method setUp.

@Before
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.context.Context) ContextImpl(org.terasology.context.internal.ContextImpl) TimeSystem(org.terasology.engine.subsystem.headless.device.TimeSystem) Before(org.junit.Before)

Example 22 with ContextImpl

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

the class IntMathTest method setUpClass.

@BeforeClass
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.context.internal.MockContext) Config(org.terasology.config.Config) ContextImpl(org.terasology.context.internal.ContextImpl) BeforeClass(org.junit.BeforeClass)

Example 23 with ContextImpl

use of org.terasology.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();
    CoreRegistry.setContext(context);
    setupPathManager();
    setupConfig();
    setupModuleManager(moduleNames);
    setupDisplay();
    setupAudio();
    AssetManager assetManager = setupAssetManager();
    setupBlockManager(assetManager);
    setupCollisionManager();
    setupNetwork();
    setupEntitySystem();
    setupStorageManager();
    setupComponentManager();
    setupWorldProvider();
    setupCelestialSystem();
    loadPrefabs();
}
Also used : AssetManager(org.terasology.assets.management.AssetManager) ContextImpl(org.terasology.context.internal.ContextImpl)

Aggregations

ContextImpl (org.terasology.context.internal.ContextImpl)23 Before (org.junit.Before)11 ModuleAwareAssetTypeManager (org.terasology.assets.module.ModuleAwareAssetTypeManager)7 Context (org.terasology.context.Context)7 ModuleManager (org.terasology.engine.module.ModuleManager)6 Prefab (org.terasology.entitySystem.prefab.Prefab)6 PrefabData (org.terasology.entitySystem.prefab.PrefabData)6 PojoPrefab (org.terasology.entitySystem.prefab.internal.PojoPrefab)6 BeforeClass (org.junit.BeforeClass)5 Test (org.junit.Test)5 Config (org.terasology.config.Config)4 NetworkSystem (org.terasology.network.NetworkSystem)4 TypeSerializationLibrary (org.terasology.persistence.typeHandling.TypeSerializationLibrary)4 MockContext (org.terasology.context.internal.MockContext)3 ComponentLibrary (org.terasology.entitySystem.metadata.ComponentLibrary)3 PojoPrefabManager (org.terasology.entitySystem.prefab.internal.PojoPrefabManager)3 SimpleUri (org.terasology.engine.SimpleUri)2 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)2 EntitySystemLibrary (org.terasology.entitySystem.metadata.EntitySystemLibrary)2 Quat4fTypeHandler (org.terasology.persistence.typeHandling.mathTypes.Quat4fTypeHandler)2