summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-12-04 09:43:58 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-12-04 09:43:58 -0500
commitaaf354761f18a18b0bcb81c9bd32819bb28deac9 (patch)
tree9a47584e0cf1f419663bdd44e48d68a4abedb4bf /src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
parent00a3c14446b716fc32c63bccf12c79bdbee436d1 (diff)
parent48adbe249270bc863e276827aa329a765f056ae0 (diff)
downloadSMAPI-aaf354761f18a18b0bcb81c9bd32819bb28deac9.tar.gz
SMAPI-aaf354761f18a18b0bcb81c9bd32819bb28deac9.tar.bz2
SMAPI-aaf354761f18a18b0bcb81c9bd32819bb28deac9.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs')
-rw-r--r--src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs b/src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
new file mode 100644
index 00000000..5cbb7e0d
--- /dev/null
+++ b/src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
@@ -0,0 +1,21 @@
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+
+namespace StardewModdingAPI.AssemblyRewriters
+{
+ /// <summary>Rewrites a method for compatibility.</summary>
+ public interface IMethodRewriter
+ {
+ /// <summary>Get whether the given method reference can be rewritten.</summary>
+ /// <param name="methodRef">The method reference.</param>
+ bool ShouldRewrite(MethodReference methodRef);
+
+ /// <summary>Rewrite a method for compatibility.</summary>
+ /// <param name="module">The module being rewritten.</param>
+ /// <param name="cil">The CIL rewriter.</param>
+ /// <param name="callOp">The instruction which calls the method.</param>
+ /// <param name="methodRef">The method reference invoked by the <paramref name="callOp"/>.</param>
+ /// <param name="assemblyMap">Metadata for mapping assemblies to the current platform.</param>
+ void Rewrite(ModuleDefinition module, ILProcessor cil, Instruction callOp, MethodReference methodRef, PlatformAssemblyMap assemblyMap);
+ }
+}