Search in sources :

Example 11 with BiomeManager

use of org.terasology.world.biomes.BiomeManager 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

BiomeManager (org.terasology.world.biomes.BiomeManager)11 Before (org.junit.Before)7 BlockManager (org.terasology.world.block.BlockManager)6 ResourceUrn (org.terasology.assets.ResourceUrn)5 AssetManager (org.terasology.assets.management.AssetManager)5 ModuleManager (org.terasology.engine.module.ModuleManager)4 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)4 BlockUri (org.terasology.world.block.BlockUri)4 SymmetricBlockFamilyFactory (org.terasology.world.block.family.SymmetricBlockFamilyFactory)4 BlockManagerImpl (org.terasology.world.block.internal.BlockManagerImpl)4 BlockFamilyDefinitionData (org.terasology.world.block.loader.BlockFamilyDefinitionData)4 NullWorldAtlas (org.terasology.world.block.tiles.NullWorldAtlas)4 Path (java.nio.file.Path)3 ModuleEnvironment (org.terasology.module.ModuleEnvironment)3 ReadWriteStorageManager (org.terasology.persistence.internal.ReadWriteStorageManager)3 WorldProvider (org.terasology.world.WorldProvider)3 ComponentSystemManager (org.terasology.engine.ComponentSystemManager)2 Game (org.terasology.game.Game)2 NetworkSystem (org.terasology.network.NetworkSystem)2 Block (org.terasology.world.block.Block)2