Пример #1
0
        /// <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);
        }
Пример #2
0
		internal static void OnStartGame() {
			Options = AIImprovementsOptionsInstance.Create(POptions.ReadSettingsForAssembly<
				AIImprovementsOptions>() ?? new AIImprovementsOptions());
#if DEBUG
			PUtil.LogDebug("Creating AllMinionsLocationHistory");
#endif
			AllMinionsLocationHistory.InitInstance();
		}
Пример #3
0
 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());
 }
Пример #4
0
		public static void OnLoad() {
			Options = new AIImprovementsOptionsInstance();
			PUtil.InitLibrary();
			PUtil.RegisterPatchClass(typeof(AIImprovementsPatches));
		}