public override ILevelLoader GetLoaderForPlaying(PlayerSpecification players, LevelLogicCustomSettings customSettings, IProgressEventWatcher parentProgress = null, double subsectionSize = 100) { throw new InvalidOperationException("Cannot load level in play mode"); }
public ILevelLoader GetLevelLoaderForPlaying(LevelRep level, PlayerSpecification players, LevelLogicCustomSettings customSettings, IProgressEventWatcher parentProgress = null, double subsectionSize = 100) { throw new NotImplementedException(); }
public override ILevelLoader GetLoaderForPlaying(PlayerSpecification players, LevelLogicCustomSettings customSettings, IProgressEventWatcher parentProgress = null, double subsectionSize = 100) { var savedLevel = GetSaveFromPackagePath(SavePath, GamePack); var loader = LevelManager.GetLoaderForPlaying(Context, savedLevel, players, customSettings, parentProgress, subsectionSize); loader.Finished += (notifier) => { Context.state = new Playing(Context, this, loader.Level); }; return(loader); }
/// <summary> /// If there is a paused running level, ends it and then creates a loader for loading <paramref name="level"/> /// for playing. /// Initializes players based on <paramref name="players"/>. /// Initializes level logic based on <paramref name="customSettings"/>. /// Can send loading updates if given <paramref name="parentProgress"/>. /// Scales the percentage updates by <paramref name="subsectionSize"/>, to enable us and the parent to go from 0 to 100. /// </summary> /// <param name="level">The level to create the loader for.</param> /// <param name="players">Data to use for player initialization.</param> /// <param name="customSettings">Settings to use for level logic plugin initialization.</param> /// <param name="parentProgress">The progress watcher for the parent.</param> /// <param name="subsectionSize">The precentage size of the level loading in the whole loading process.</param> /// <returns>A loader for the <paramref name="level"/> that can be used to load the <paramref name="level"/> for editing.</returns> public ILevelLoader GetLevelLoaderForPlaying(LevelRep level, PlayerSpecification players, LevelLogicCustomSettings customSettings, IProgressEventWatcher parentProgress = null, double subsectionSize = 100) { if (pausedLevelController != null) { EndPausedLevel(); } return(level.GetLoaderForPlaying(players, customSettings, parentProgress, subsectionSize)); }