From c513bb011c858e59abbd77f75080f4a1d8b712f9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 19 Sep 2017 22:52:52 -0400 Subject: pass mod metadata into rewriters (#347) --- .../Framework/ModLoading/Rewriters/MethodParentRewriter.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/StardewModdingAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs') diff --git a/src/StardewModdingAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs b/src/StardewModdingAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs index 1b95b83b..1e116e1f 100644 --- a/src/StardewModdingAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs +++ b/src/StardewModdingAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs @@ -44,18 +44,20 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters } /// Rewrite a method definition for compatibility. + /// The mod to which the module belongs. /// The module being rewritten. /// The method definition to rewrite. /// Metadata for mapping assemblies to the current platform. /// Whether the mod was compiled on a different platform. /// Returns whether the instruction was rewritten. /// The CIL instruction is not compatible, and can't be rewritten. - public bool Rewrite(ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged) + public bool Rewrite(IModMetadata mod, ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged) { return false; } /// Rewrite a CIL instruction for compatibility. + /// The mod to which the module belongs. /// The module being rewritten. /// The CIL rewriter. /// The instruction to rewrite. @@ -63,7 +65,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters /// Whether the mod was compiled on a different platform. /// Returns whether the instruction was rewritten. /// The CIL instruction is not compatible, and can't be rewritten. - public bool Rewrite(ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged) + public bool Rewrite(IModMetadata mod, ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged) { if (!this.IsMatch(instruction, platformChanged)) return false; -- cgit