Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public void Test_CalculateMethod_DllMissing()
 {
     Assert.Throws <DllNotFoundException>(() =>
                                          PatchManager.Apply(typeof(PatchTest2))
                                          );
 }
Exemplo n.º 3
0
 public void Test_CalculateMethod_MethodMissing()
 {
     Assert.Throws <MissingMethodException>(() => PatchManager.Apply(typeof(PatchTest5)));
 }
Exemplo n.º 4
0
 public void Test_CalculateMethod_TypeMissing()
 {
     Assert.Throws <TypeLoadException>(() => PatchManager.Apply(typeof(PatchTest4)));
 }
Exemplo n.º 5
0
 public void Test_CalculateMethod_DllWrongVersion()
 {
     Assert.Throws <DllNotFoundException>(() => PatchManager.Apply(typeof(PatchTest3)));
 }