コード例 #1
0
ファイル: ModEntry.cs プロジェクト: ZaRx485/smapi-mod-dump
        private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
        {
            IQualityProductsAPI qualityProductsAPI = Helper.ModRegistry.GetApi <IQualityProductsAPI>("SilentOak.QualityProducts");

            if (qualityProductsAPI == null)
            {
                Monitor.Log("Could not find Quality Products' API. This mod will be disabled.", LogLevel.Error);
                return;
            }

            RecipeManager.Init(qualityProductsAPI);

            PatchManager.Apply(typeof(MachineGenericPullRecipePatch));
        }
コード例 #2
0
 public void Test_CalculateMethod_DllMissing()
 {
     Assert.Throws <DllNotFoundException>(() =>
                                          PatchManager.Apply(typeof(PatchTest2))
                                          );
 }
コード例 #3
0
 public void Test_CalculateMethod_MethodMissing()
 {
     Assert.Throws <MissingMethodException>(() => PatchManager.Apply(typeof(PatchTest5)));
 }
コード例 #4
0
 public void Test_CalculateMethod_TypeMissing()
 {
     Assert.Throws <TypeLoadException>(() => PatchManager.Apply(typeof(PatchTest4)));
 }
コード例 #5
0
 public void Test_CalculateMethod_DllWrongVersion()
 {
     Assert.Throws <DllNotFoundException>(() => PatchManager.Apply(typeof(PatchTest3)));
 }