summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-11-29 19:27:10 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-11-29 19:27:10 -0500
commitdf8f44c7047812a5f2af567324df1e287a6e4427 (patch)
tree6c97183322d27fa78fdc563d70ac40d3d4691cda /src/StardewModdingAPI.AssemblyRewriters/IMethodRewriter.cs
parentd5932a0d772bc145c4b5a2376bff03dbe724b322 (diff)
parent98a3289337f007ce580e2d45a65a1e5bd7498aeb (diff)
downloadSMAPI-df8f44c7047812a5f2af567324df1e287a6e4427.tar.gz
SMAPI-df8f44c7047812a5f2af567324df1e287a6e4427.tar.bz2
SMAPI-df8f44c7047812a5f2af567324df1e287a6e4427.zip
Merge branch 'feature/rewrite-mod-assemblies' into develop
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);
+ }
+}