internal void BootAll(BootStage stage) { try { foreach (ModDefinition mod in _mods) { mod.BootUp(stage); } } catch (Exception e) { throw new ModLoadingSequenceFailureException("Loading failed at " + stage.ToString(), e); } }
internal void BootUp(BootStage stage) { Console.WriteLine("Booting up " + stage.ToString().ToLowerInvariant() + " for " + _modfile.Name); switch (stage) { case BootStage.ITEMS: _masterClass.InitItems(ItemRegistry.Instance); break; case BootStage.RECIPES: _masterClass.InitRecipes(RecipeRegistry.Instance); break; case BootStage.PROJECTS: _masterClass.InitProjects(ProjectRegistry.Instance); break; default: throw new InvalidOperationException("Requested modload stage is unknown"); } }
/// <summary> /// Initializes a new instance of the <see cref="MissingBootStage"/> class. /// </summary> /// <param name="bootStage">The <see cref="BootStage"/> that is missing.</param> public MissingBootStage(BootStage bootStage) : base($"BootStage '{bootStage}' is missing - this could be due to a missing dependency that should be adding the boot stage") { }