diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Finders/EventFinder.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Finders/GenericEventFinder.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Finders/FieldFinder.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Finders/GenericFieldFinder.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Finders/MethodFinder.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Finders/GenericMethodFinder.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Finders/TypeFinder.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Finders/GenericTypeFinder.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Rewriters/FieldToPropertyRewriter.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericFieldToPropertyRewriter.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/Rewriters/MethodParentRewriter.cs (renamed from src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericMethodMapper.cs) | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI.AssemblyRewriters/StardewModdingAPI.AssemblyRewriters.csproj | 20 | ||||
-rw-r--r-- | src/StardewModdingAPI/Constants.cs | 46 |
8 files changed, 45 insertions, 45 deletions
diff --git a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericEventFinder.cs b/src/StardewModdingAPI.AssemblyRewriters/Finders/EventFinder.cs index c2a981e5..359ca63e 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericEventFinder.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Finders/EventFinder.cs @@ -5,7 +5,7 @@ using StardewModdingAPI.AssemblyRewriters.Framework; namespace StardewModdingAPI.AssemblyRewriters.Finders { /// <summary>Finds CIL instructions that reference a given event.</summary> - public sealed class GenericEventFinder : BaseMethodFinder + public sealed class EventFinder : BaseMethodFinder { /********* ** Properties @@ -30,7 +30,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Finders /// <summary>Construct an instance.</summary> /// <param name="fullTypeName">The full type name for which to find references.</param> /// <param name="eventName">The event name for which to find references.</param> - public GenericEventFinder(string fullTypeName, string eventName) + public EventFinder(string fullTypeName, string eventName) { this.FullTypeName = fullTypeName; this.EventName = eventName; diff --git a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericFieldFinder.cs b/src/StardewModdingAPI.AssemblyRewriters/Finders/FieldFinder.cs index 056422a4..516641f2 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericFieldFinder.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Finders/FieldFinder.cs @@ -5,7 +5,7 @@ using StardewModdingAPI.AssemblyRewriters.Framework; namespace StardewModdingAPI.AssemblyRewriters.Finders { /// <summary>Finds CIL instructions that reference a given field.</summary> - public sealed class GenericFieldFinder : BaseFieldFinder + public sealed class FieldFinder : BaseFieldFinder { /********* ** Properties @@ -34,7 +34,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Finders /// <param name="fullTypeName">The full type name for which to find references.</param> /// <param name="fieldName">The field name for which to find references.</param> /// <param name="isStatic">Whether the field to match is static.</param> - public GenericFieldFinder(string fullTypeName, string fieldName, bool isStatic) + public FieldFinder(string fullTypeName, string fieldName, bool isStatic) { this.FullTypeName = fullTypeName; this.FieldName = fieldName; diff --git a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericMethodFinder.cs b/src/StardewModdingAPI.AssemblyRewriters/Finders/MethodFinder.cs index f5443558..6c210d68 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericMethodFinder.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Finders/MethodFinder.cs @@ -5,7 +5,7 @@ using StardewModdingAPI.AssemblyRewriters.Framework; namespace StardewModdingAPI.AssemblyRewriters.Finders { /// <summary>Finds CIL instructions that reference a given method.</summary> - public sealed class GenericMethodFinder : BaseMethodFinder + public sealed class MethodFinder : BaseMethodFinder { /********* ** Properties @@ -30,7 +30,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Finders /// <summary>Construct an instance.</summary> /// <param name="fullTypeName">The full type name for which to find references.</param> /// <param name="methodName">The method name for which to find references.</param> - public GenericMethodFinder(string fullTypeName, string methodName) + public MethodFinder(string fullTypeName, string methodName) { this.FullTypeName = fullTypeName; this.MethodName = methodName; diff --git a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericTypeFinder.cs b/src/StardewModdingAPI.AssemblyRewriters/Finders/TypeFinder.cs index 1556cc3c..ba8e7102 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Finders/GenericTypeFinder.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Finders/TypeFinder.cs @@ -5,7 +5,7 @@ using Mono.Cecil.Cil; namespace StardewModdingAPI.AssemblyRewriters.Finders { /// <summary>Finds CIL instructions that reference a given type.</summary> - public sealed class GenericTypeFinder : IInstructionFinder + public sealed class TypeFinder : IInstructionFinder { /********* ** Accessors @@ -26,7 +26,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Finders *********/ /// <summary>Construct an instance.</summary> /// <param name="fullTypeName">The full type name to match.</param> - public GenericTypeFinder(string fullTypeName) + public TypeFinder(string fullTypeName) { this.FullTypeName = fullTypeName; this.NounPhrase = $"obsolete {fullTypeName} type"; diff --git a/src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericFieldToPropertyRewriter.cs b/src/StardewModdingAPI.AssemblyRewriters/Rewriters/FieldToPropertyRewriter.cs index f58bcfbb..caf0a16c 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericFieldToPropertyRewriter.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Rewriters/FieldToPropertyRewriter.cs @@ -6,7 +6,7 @@ using StardewModdingAPI.AssemblyRewriters.Framework; namespace StardewModdingAPI.AssemblyRewriters.Rewriters { /// <summary>Rewrites field references into property references.</summary> - public class GenericFieldToPropertyRewriter : BaseFieldRewriter + public class FieldToPropertyRewriter : BaseFieldRewriter { /********* ** Properties @@ -32,7 +32,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Rewriters /// <param name="type">The type whose field to which references should be rewritten.</param> /// <param name="fieldName">The field name to rewrite.</param> /// <param name="nounPhrase">A brief noun phrase indicating what the instruction finder matches (or <c>null</c> to generate one).</param> - public GenericFieldToPropertyRewriter(Type type, string fieldName, string nounPhrase = null) + public FieldToPropertyRewriter(Type type, string fieldName, string nounPhrase = null) { this.Type = type; this.FieldName = fieldName; diff --git a/src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericMethodMapper.cs b/src/StardewModdingAPI.AssemblyRewriters/Rewriters/MethodParentRewriter.cs index 49e0aad7..9c19f473 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/Rewriters/GenericMethodMapper.cs +++ b/src/StardewModdingAPI.AssemblyRewriters/Rewriters/MethodParentRewriter.cs @@ -6,7 +6,7 @@ using StardewModdingAPI.AssemblyRewriters.Framework; namespace StardewModdingAPI.AssemblyRewriters.Rewriters { /// <summary>Rewrites method references from one parent type to another if the signatures match.</summary> - public class GenericMethodMapper : BaseMethodRewriter + public class MethodParentRewriter : BaseMethodRewriter { /********* ** Properties @@ -36,7 +36,7 @@ namespace StardewModdingAPI.AssemblyRewriters.Rewriters /// <param name="toType">The type with methods to map to.</param> /// <param name="onlyIfPlatformChanged">Whether to only rewrite references if loading the assembly on a different platform than it was compiled on.</param> /// <param name="nounPhrase">A brief noun phrase indicating what the instruction finder matches (or <c>null</c> to generate one).</param> - public GenericMethodMapper(Type fromType, Type toType, bool onlyIfPlatformChanged = false, string nounPhrase = null) + public MethodParentRewriter(Type fromType, Type toType, bool onlyIfPlatformChanged = false, string nounPhrase = null) { this.FromType = fromType; this.ToType = toType; diff --git a/src/StardewModdingAPI.AssemblyRewriters/StardewModdingAPI.AssemblyRewriters.csproj b/src/StardewModdingAPI.AssemblyRewriters/StardewModdingAPI.AssemblyRewriters.csproj index 8416aad7..90e800d0 100644 --- a/src/StardewModdingAPI.AssemblyRewriters/StardewModdingAPI.AssemblyRewriters.csproj +++ b/src/StardewModdingAPI.AssemblyRewriters/StardewModdingAPI.AssemblyRewriters.csproj @@ -66,22 +66,22 @@ <Compile Include="..\GlobalAssemblyInfo.cs"> <Link>Properties\GlobalAssemblyInfo.cs</Link> </Compile> - <Compile Include="Finders\GenericFieldFinder.cs" /> - <Compile Include="Finders\GenericEventFinder.cs" /> - <Compile Include="Finders\GenericMethodFinder.cs" /> + <Compile Include="Finders\EventFinder.cs" /> + <Compile Include="Finders\FieldFinder.cs" /> + <Compile Include="Finders\MethodFinder.cs" /> + <Compile Include="Finders\TypeFinder.cs" /> <Compile Include="Framework\BaseFieldFinder.cs" /> + <Compile Include="Framework\BaseFieldRewriter.cs" /> <Compile Include="Framework\BaseMethodFinder.cs" /> - <Compile Include="Finders\GenericTypeFinder.cs" /> - <Compile Include="IInstructionRewriter.cs" /> + <Compile Include="Framework\BaseMethodRewriter.cs" /> + <Compile Include="Framework\RewriteHelper.cs" /> <Compile Include="IInstructionFinder.cs" /> + <Compile Include="IInstructionRewriter.cs" /> <Compile Include="Platform.cs" /> <Compile Include="PlatformAssemblyMap.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Framework\BaseFieldRewriter.cs" /> - <Compile Include="Framework\BaseMethodRewriter.cs" /> - <Compile Include="Framework\RewriteHelper.cs" /> - <Compile Include="Rewriters\GenericFieldToPropertyRewriter.cs" /> - <Compile Include="Rewriters\GenericMethodMapper.cs" /> + <Compile Include="Rewriters\FieldToPropertyRewriter.cs" /> + <Compile Include="Rewriters\MethodParentRewriter.cs" /> <Compile Include="Rewriters\Wrappers\SpriteBatchWrapper.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/StardewModdingAPI/Constants.cs b/src/StardewModdingAPI/Constants.cs index 1965cae3..5fa25014 100644 --- a/src/StardewModdingAPI/Constants.cs +++ b/src/StardewModdingAPI/Constants.cs @@ -143,27 +143,27 @@ namespace StardewModdingAPI return new IInstructionFinder[] { // changes in Stardew Valley 1.2 (that don't have rewriters) - new GenericFieldFinder("StardewValley.Game1", "borderFont", isStatic: true), - new GenericFieldFinder("StardewValley.Game1", "smoothFont", isStatic: true), - new GenericFieldFinder("StardewValley.Item", "set_Name", isStatic: false), + new FieldFinder("StardewValley.Game1", "borderFont", isStatic: true), + new FieldFinder("StardewValley.Game1", "smoothFont", isStatic: true), + new FieldFinder("StardewValley.Item", "set_Name", isStatic: false), // APIs removed in SMAPI 1.9 - new GenericTypeFinder("StardewModdingAPI.Advanced.ConfigFile"), - new GenericTypeFinder("StardewModdingAPI.Advanced.IConfigFile"), - new GenericTypeFinder("StardewModdingAPI.Entities.SPlayer"), - new GenericTypeFinder("StardewModdingAPI.Extensions"), - new GenericTypeFinder("StardewModdingAPI.Inheritance.ItemStackChange"), - new GenericTypeFinder("StardewModdingAPI.Inheritance.SGame"), - new GenericTypeFinder("StardewModdingAPI.Inheritance.SObject"), - new GenericTypeFinder("StardewModdingAPI.LogWriter"), - new GenericTypeFinder("StardewModdingAPI.Manifest"), - new GenericTypeFinder("StardewModdingAPI.Version"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "DrawDebug"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "DrawTick"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPostRenderHudEventNoCheck"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPostRenderGuiEventNoCheck"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPreRenderHudEventNoCheck"), - new GenericEventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPreRenderGuiEventNoCheck") + new TypeFinder("StardewModdingAPI.Advanced.ConfigFile"), + new TypeFinder("StardewModdingAPI.Advanced.IConfigFile"), + new TypeFinder("StardewModdingAPI.Entities.SPlayer"), + new TypeFinder("StardewModdingAPI.Extensions"), + new TypeFinder("StardewModdingAPI.Inheritance.ItemStackChange"), + new TypeFinder("StardewModdingAPI.Inheritance.SGame"), + new TypeFinder("StardewModdingAPI.Inheritance.SObject"), + new TypeFinder("StardewModdingAPI.LogWriter"), + new TypeFinder("StardewModdingAPI.Manifest"), + new TypeFinder("StardewModdingAPI.Version"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "DrawDebug"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "DrawTick"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPostRenderHudEventNoCheck"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPostRenderGuiEventNoCheck"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPreRenderHudEventNoCheck"), + new EventFinder("StardewModdingAPI.Events.GraphicsEvents", "OnPreRenderGuiEventNoCheck") }; } @@ -173,12 +173,12 @@ namespace StardewModdingAPI return new IInstructionRewriter[] { // crossplatform - new GenericMethodMapper(typeof(SpriteBatch), typeof(SpriteBatchWrapper), onlyIfPlatformChanged: true), + new MethodParentRewriter(typeof(SpriteBatch), typeof(SpriteBatchWrapper), onlyIfPlatformChanged: true), // Stardew Valley 1.2 - new GenericFieldToPropertyRewriter(typeof(Game1), nameof(Game1.activeClickableMenu)), - new GenericFieldToPropertyRewriter(typeof(Game1), nameof(Game1.gameMode)), - new GenericFieldToPropertyRewriter(typeof(Game1), nameof(Game1.player)) + new FieldToPropertyRewriter(typeof(Game1), nameof(Game1.activeClickableMenu)), + new FieldToPropertyRewriter(typeof(Game1), nameof(Game1.gameMode)), + new FieldToPropertyRewriter(typeof(Game1), nameof(Game1.player)) }; } |