/// <summary> /// Creates a new instance of AI Improvements Options. /// </summary> /// <param name="options">The options read from the file.</param> /// <returns>A non-null instance to use for options lookup.</returns> public static AIImprovementsOptionsInstance Create(AIImprovementsOptions options) { var ret = new AIImprovementsOptionsInstance(); if (options != null) { // Buildings that get +0.3 var collection = options.PrioritizeBuildings; if (collection != null) { foreach (var id in collection) { if (!string.IsNullOrEmpty(id)) { ret.PrioritizeBuildings.Add(id); } } } // Buildings that get -0.3 collection = options.DeprioritizeBuildings; if (collection != null) { foreach (var id in collection) { if (!string.IsNullOrEmpty(id)) { ret.DeprioritizeBuildings.Add(id); } } } } return(ret); }
internal static void OnStartGame() { Options = AIImprovementsOptionsInstance.Create(POptions.ReadSettingsForAssembly< AIImprovementsOptions>() ?? new AIImprovementsOptions()); #if DEBUG PUtil.LogDebug("Creating AllMinionsLocationHistory"); #endif AllMinionsLocationHistory.InitInstance(); }
public override void OnLoad(Harmony harmony) { base.OnLoad(harmony); PUtil.InitLibrary(); Options = new AIImprovementsOptionsInstance(); new POptions().RegisterOptions(this, typeof(AIImprovementsOptions)); new PPatchManager(harmony).RegisterPatchClass(typeof(AIImprovementsPatches)); new PVersionCheck().Register(this, new SteamVersionChecker()); }
public static void OnLoad() { Options = new AIImprovementsOptionsInstance(); PUtil.InitLibrary(); PUtil.RegisterPatchClass(typeof(AIImprovementsPatches)); }