summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-20 12:43:08 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-20 12:43:08 -0400
commite64ecc89f94641d4054162eff4943f660f43030f (patch)
treec43ca79f9947b3e16f946e1dc5fd1d02f70ce571 /src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
parentdf6e745c6b842290338317ed1d3e969ee222998c (diff)
parentcb9ff7019995eff92104703f097856d2523e02ce (diff)
downloadSMAPI-e64ecc89f94641d4054162eff4943f660f43030f.tar.gz
SMAPI-e64ecc89f94641d4054162eff4943f660f43030f.tar.bz2
SMAPI-e64ecc89f94641d4054162eff4943f660f43030f.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/IInstructionHandler.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/IInstructionHandler.cs32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs b/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
index 8830cc74..e6de6785 100644
--- a/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
+++ b/src/SMAPI/Framework/ModLoading/IInstructionHandler.cs
@@ -1,3 +1,5 @@
+using System;
+using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
@@ -9,26 +11,32 @@ namespace StardewModdingAPI.Framework.ModLoading
/*********
** Accessors
*********/
- /// <summary>A brief noun phrase indicating what the handler matches.</summary>
- string NounPhrase { get; }
+ /// <summary>A brief noun phrase indicating what the handler matches, used if <see cref="Phrases"/> is empty.</summary>
+ string DefaultPhrase { get; }
+
+ /// <summary>The rewrite flags raised for the current module.</summary>
+ ISet<InstructionHandleResult> Flags { get; }
+
+ /// <summary>The brief noun phrases indicating what the handler matched for the current module.</summary>
+ ISet<string> Phrases { get; }
/*********
** Methods
*********/
- /// <summary>Perform the predefined logic for a method if applicable.</summary>
+ /// <summary>Rewrite a type reference if needed.</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);
+ /// <param name="type">The type definition to handle.</param>
+ /// <param name="replaceWith">Replaces the type reference with a new one.</param>
+ /// <returns>Returns whether the type was changed.</returns>
+ bool Handle(ModuleDefinition module, TypeReference type, Action<TypeReference> replaceWith);
- /// <summary>Perform the predefined logic for an instruction if applicable.</summary>
+ /// <summary>Rewrite a CIL instruction reference if needed.</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);
+ /// <param name="instruction">The CIL instruction to handle.</param>
+ /// <param name="replaceWith">Replaces the CIL instruction with a new one.</param>
+ /// <returns>Returns whether the instruction was changed.</returns>
+ bool Handle(ModuleDefinition module, ILProcessor cil, Instruction instruction, Action<Instruction> replaceWith);
}
}