summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/IInstructionHandler.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/IInstructionHandler.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs b/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
new file mode 100644
index 00000000..8830cc74
--- /dev/null
+++ b/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
@@ -0,0 +1,34 @@
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+
+namespace StardewModdingAPI.Framework.ModLoading
+{
+ /// <summary>Performs predefined logic for detected CIL instructions.</summary>
+ internal interface IInstructionHandler
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>A brief noun phrase indicating what the handler matches.</summary>
+ string NounPhrase { get; }
+
+
+ /*********
+ ** Methods
+ *********/
+ /// <summary>Perform the predefined logic for a method if applicable.</summary>
+ /// <param name="module">The assembly module containing the instruction.</param>
+ /// <param name="method">The method definition containing the instruction.</param>
+ /// <param name="assemblyMap">Metadata for mapping assemblies to the current platform.</param>
+ /// <param name="platformChanged">Whether the mod was compiled on a different platform.</param>
+ InstructionHandleResult Handle(ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged);
+
+ /// <summary>Perform the predefined logic for an instruction if applicable.</summary>
+ /// <param name="module">The assembly module containing the instruction.</param>
+ /// <param name="cil">The CIL processor.</param>
+ /// <param name="instruction">The instruction to handle.</param>
+ /// <param name="assemblyMap">Metadata for mapping assemblies to the current platform.</param>
+ /// <param name="platformChanged">Whether the mod was compiled on a different platform.</param>
+ InstructionHandleResult Handle(ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged);
+ }
+}