Search in sources :

Example 6 with EngineSubsystem

use of org.terasology.engine.subsystem.EngineSubsystem in project Terasology by MovingBlocks.

the class TerasologyEngine method preInitSubsystems.

/**
 * Gives a chance to subsystems to do something BEFORE managers and Time are initialized.
 */
private void preInitSubsystems() {
    changeStatus(TerasologyEngineStatus.PREPARING_SUBSYSTEMS);
    for (EngineSubsystem subsystem : getSubsystems()) {
        changeStatus(() -> "Pre-initialising " + subsystem.getName() + " subsystem");
        subsystem.preInitialise(rootContext);
    }
}
Also used : EngineSubsystem(org.terasology.engine.subsystem.EngineSubsystem)

Example 7 with EngineSubsystem

use of org.terasology.engine.subsystem.EngineSubsystem 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;
}
Also used : EngineSubsystem(org.terasology.engine.subsystem.EngineSubsystem) GameEngine(org.terasology.engine.GameEngine) ModuleManager(org.terasology.engine.module.ModuleManager) TerasologyEngine(org.terasology.engine.TerasologyEngine) ComponentSystemManager(org.terasology.engine.ComponentSystemManager)

Example 8 with EngineSubsystem

use of org.terasology.engine.subsystem.EngineSubsystem in project Terasology by MovingBlocks.

the class TerasologyEngine method initAssets.

private void initAssets() {
    DefaultBlockFamilyFactoryRegistry familyFactoryRegistry = new DefaultBlockFamilyFactoryRegistry();
    rootContext.put(BlockFamilyFactoryRegistry.class, familyFactoryRegistry);
    // cast lambdas explicitly to avoid inconsistent compiler behavior wrt. type inference
    assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, false, "prefabs");
    assetTypeManager.registerCoreAssetType(BlockShape.class, (AssetFactory<BlockShape, BlockShapeData>) BlockShapeImpl::new, "shapes");
    assetTypeManager.registerCoreAssetType(BlockSounds.class, (AssetFactory<BlockSounds, BlockSoundsData>) BlockSounds::new, "blockSounds");
    assetTypeManager.registerCoreAssetType(BlockTile.class, (AssetFactory<BlockTile, TileData>) BlockTile::new, "blockTiles");
    assetTypeManager.registerCoreAssetType(BlockFamilyDefinition.class, (AssetFactory<BlockFamilyDefinition, BlockFamilyDefinitionData>) BlockFamilyDefinition::new, "blocks");
    assetTypeManager.registerCoreFormat(BlockFamilyDefinition.class, new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager(), familyFactoryRegistry));
    assetTypeManager.registerCoreAssetType(UISkin.class, (AssetFactory<UISkin, UISkinData>) UISkin::new, "skins");
    assetTypeManager.registerCoreAssetType(BehaviorTree.class, (AssetFactory<BehaviorTree, BehaviorTreeData>) BehaviorTree::new, false, "behaviors");
    assetTypeManager.registerCoreAssetType(UIElement.class, (AssetFactory<UIElement, UIData>) UIElement::new, "ui");
    for (EngineSubsystem subsystem : allSubsystems) {
        subsystem.registerCoreAssetTypes(assetTypeManager);
    }
}
Also used : UIElement(org.terasology.rendering.nui.asset.UIElement) PrefabData(org.terasology.entitySystem.prefab.PrefabData) BehaviorTreeData(org.terasology.logic.behavior.asset.BehaviorTreeData) BlockShape(org.terasology.world.block.shapes.BlockShape) BlockFamilyDefinitionFormat(org.terasology.world.block.loader.BlockFamilyDefinitionFormat) UISkin(org.terasology.rendering.nui.skin.UISkin) UISkinData(org.terasology.rendering.nui.skin.UISkinData) BlockTile(org.terasology.world.block.tiles.BlockTile) DefaultBlockFamilyFactoryRegistry(org.terasology.world.block.family.DefaultBlockFamilyFactoryRegistry) BehaviorTree(org.terasology.logic.behavior.asset.BehaviorTree) BlockShapeData(org.terasology.world.block.shapes.BlockShapeData) UIData(org.terasology.rendering.nui.asset.UIData) BlockSounds(org.terasology.world.block.sounds.BlockSounds) BlockSoundsData(org.terasology.world.block.sounds.BlockSoundsData) TileData(org.terasology.world.block.tiles.TileData) BlockFamilyDefinitionData(org.terasology.world.block.loader.BlockFamilyDefinitionData) EngineSubsystem(org.terasology.engine.subsystem.EngineSubsystem) BlockFamilyDefinition(org.terasology.world.block.loader.BlockFamilyDefinition) Prefab(org.terasology.entitySystem.prefab.Prefab) PojoPrefab(org.terasology.entitySystem.prefab.internal.PojoPrefab)

Aggregations

EngineSubsystem (org.terasology.engine.subsystem.EngineSubsystem)8 ComponentSystemManager (org.terasology.engine.ComponentSystemManager)1 GameEngine (org.terasology.engine.GameEngine)1 TerasologyEngine (org.terasology.engine.TerasologyEngine)1 ModuleManager (org.terasology.engine.module.ModuleManager)1 HibernationSubsystem (org.terasology.engine.subsystem.common.hibernation.HibernationSubsystem)1 BindsSubsystem (org.terasology.engine.subsystem.config.BindsSubsystem)1 HeadlessAudio (org.terasology.engine.subsystem.headless.HeadlessAudio)1 HeadlessGraphics (org.terasology.engine.subsystem.headless.HeadlessGraphics)1 HeadlessInput (org.terasology.engine.subsystem.headless.HeadlessInput)1 HeadlessTimer (org.terasology.engine.subsystem.headless.HeadlessTimer)1 LwjglAudio (org.terasology.engine.subsystem.lwjgl.LwjglAudio)1 LwjglGraphics (org.terasology.engine.subsystem.lwjgl.LwjglGraphics)1 LwjglInput (org.terasology.engine.subsystem.lwjgl.LwjglInput)1 LwjglTimer (org.terasology.engine.subsystem.lwjgl.LwjglTimer)1 OpenVRInput (org.terasology.engine.subsystem.openvr.OpenVRInput)1 Prefab (org.terasology.entitySystem.prefab.Prefab)1 PrefabData (org.terasology.entitySystem.prefab.PrefabData)1 PojoPrefab (org.terasology.entitySystem.prefab.internal.PojoPrefab)1 BehaviorTree (org.terasology.logic.behavior.asset.BehaviorTree)1