コード例 #1
0
 public void UnregisterKernel(IKernel kernel)
 {
     if (!_kernelScenarios.ContainsKey(kernel))
     {
         return;
     }
     MainScenario.Remove(_kernelScenarios[kernel]);
     _kernelScenarios.Remove(kernel);
 }
コード例 #2
0
        public virtual void Execute()
        {
            if (!IsStarted)
            {
                Start();
            }

            MainScenario.Execute();
            MainScenario.Cleanup();
        }
コード例 #3
0
        [HarmonyPatch(typeof(MainScenario), nameof(MainScenario.LoadReadInfo))] // already read adv text
        private static Exception CatchReadInfoCrash(Exception __exception)
        {
            if (__exception != null)
            {
                Logger.Log(LogLevel.Warning | LogLevel.Message, "ADV memory file was corrupted, you might no longer be able to skip previously read text.");
                Logger.LogWarning(__exception);

                File.Delete(Path.Combine(UserData.Path, "save/read.dat"));
                // Try again, this time it'll create a blank state since file doesn't exist
                MainScenario.LoadReadInfo();
            }

            return(null);
        }
コード例 #4
0
        public void RegisterKernel(IKernel kernel)
        {
            if (kernel.PoolInterfaces != null)
            {
                foreach (var poolInterface in kernel.PoolInterfaces)
                {
                    Pools.Register(poolInterface);
                }
            }

            var scenario = kernel.SetupScenario(Pools);

            _kernelScenarios.Add(kernel, scenario);

            scenario.SetPools(Pools);

            scenario.SetApplication(this);
            MainScenario.Add(scenario);
            scenario.Initialize();
        }