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); } }