using Mono.Cecil; using Mono.Cecil.Cil; namespace StardewModdingAPI.AssemblyRewriters { /// Rewrites CIL instructions for compatibility. public interface IInstructionRewriter { /********* ** Accessors *********/ /// A brief noun phrase indicating what the rewriter matches. string NounPhrase { get; } /********* ** Methods *********/ /// Rewrite a method definition for compatibility. /// The module being rewritten. /// The method definition to rewrite. /// Metadata for mapping assemblies to the current platform. /// Whether the mod was compiled on a different platform. /// Returns whether the instruction was rewritten. /// The CIL instruction is not compatible, and can't be rewritten. bool Rewrite(ModuleDefinition module, MethodDefinition method, PlatformAssemblyMap assemblyMap, bool platformChanged); /// Rewrite a CIL instruction for compatibility. /// The module being rewritten. /// The CIL rewriter. /// The instruction to rewrite. /// Metadata for mapping assemblies to the current platform. /// Whether the mod was compiled on a different platform. /// Returns whether the instruction was rewritten. /// The CIL instruction is not compatible, and can't be rewritten. bool Rewrite(ModuleDefinition module, ILProcessor cil, Instruction instruction, PlatformAssemblyMap assemblyMap, bool platformChanged); } }