summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r--src/StardewModdingAPI/Constants.cs3
-rw-r--r--src/StardewModdingAPI/Framework/AssemblyRewriting/AssemblyTypeRewriter.cs1
-rw-r--r--src/StardewModdingAPI/Framework/AssemblyRewriting/PlatformAssemblyMap.cs35
-rw-r--r--src/StardewModdingAPI/Framework/ModAssemblyLoader.cs1
-rw-r--r--src/StardewModdingAPI/Framework/Platform.cs12
-rw-r--r--src/StardewModdingAPI/Program.cs1
-rw-r--r--src/StardewModdingAPI/StardewModdingAPI.csproj9
7 files changed, 11 insertions, 51 deletions
diff --git a/src/StardewModdingAPI/Constants.cs b/src/StardewModdingAPI/Constants.cs
index 66eb1336..b9074b6e 100644
--- a/src/StardewModdingAPI/Constants.cs
+++ b/src/StardewModdingAPI/Constants.cs
@@ -2,8 +2,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
-using StardewModdingAPI.Framework;
-using StardewModdingAPI.Framework.AssemblyRewriting;
+using StardewModdingAPI.AssemblyRewriters;
using StardewValley;
namespace StardewModdingAPI
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/AssemblyTypeRewriter.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/AssemblyTypeRewriter.cs
index 66c36c03..43f6aa11 100644
--- a/src/StardewModdingAPI/Framework/AssemblyRewriting/AssemblyTypeRewriter.cs
+++ b/src/StardewModdingAPI/Framework/AssemblyRewriting/AssemblyTypeRewriter.cs
@@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using Mono.Cecil;
+using StardewModdingAPI.AssemblyRewriters;
namespace StardewModdingAPI.Framework.AssemblyRewriting
{
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/PlatformAssemblyMap.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/PlatformAssemblyMap.cs
deleted file mode 100644
index 3e6cec8a..00000000
--- a/src/StardewModdingAPI/Framework/AssemblyRewriting/PlatformAssemblyMap.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-
-namespace StardewModdingAPI.Framework.AssemblyRewriting
-{
- /// <summary>Metadata for mapping assemblies to the current <see cref="Platform"/>.</summary>
- internal class PlatformAssemblyMap
- {
- /*********
- ** Accessors
- *********/
- /// <summary>The target game platform.</summary>
- public readonly Platform TargetPlatform;
-
- /// <summary>The short assembly names to remove as assembly reference, and replace with the <see cref="Targets"/>. These should be short names (like "Stardew Valley").</summary>
- public readonly string[] RemoveNames;
-
- /// <summary>The assembly filenames to target. Equivalent types should be rewritten to use these assemblies.</summary>
- public readonly Assembly[] Targets;
-
-
- /*********
- ** Public methods
- *********/
- /// <summary>Construct an instance.</summary>
- /// <param name="targetPlatform">The target game platform.</param>
- /// <param name="removeAssemblyNames">The assembly short names to remove (like <c>Stardew Valley</c>).</param>
- /// <param name="targetAssemblies">The assemblies to target.</param>
- public PlatformAssemblyMap(Platform targetPlatform, string[] removeAssemblyNames, Assembly[] targetAssemblies)
- {
- this.TargetPlatform = targetPlatform;
- this.RemoveNames = removeAssemblyNames;
- this.Targets = targetAssemblies;
- }
- }
-} \ No newline at end of file
diff --git a/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs b/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs
index b6d98bde..e095cde8 100644
--- a/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs
+++ b/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using Mono.Cecil;
+using StardewModdingAPI.AssemblyRewriters;
using StardewModdingAPI.Framework.AssemblyRewriting;
namespace StardewModdingAPI.Framework
diff --git a/src/StardewModdingAPI/Framework/Platform.cs b/src/StardewModdingAPI/Framework/Platform.cs
deleted file mode 100644
index cab81e06..00000000
--- a/src/StardewModdingAPI/Framework/Platform.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace StardewModdingAPI.Framework
-{
- /// <summary>The game's platform version.</summary>
- internal enum Platform
- {
- /// <summary>The Linux/Mac version of the game.</summary>
- Mono,
-
- /// <summary>The Windows version of the game.</summary>
- Windows
- }
-} \ No newline at end of file
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index bed4cafc..f0686039 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -9,6 +9,7 @@ using System.Windows.Forms;
#endif
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json;
+using StardewModdingAPI.AssemblyRewriters;
using StardewModdingAPI.Events;
using StardewModdingAPI.Framework;
using StardewModdingAPI.Inheritance;
diff --git a/src/StardewModdingAPI/StardewModdingAPI.csproj b/src/StardewModdingAPI/StardewModdingAPI.csproj
index efd760f2..6f3bcb4b 100644
--- a/src/StardewModdingAPI/StardewModdingAPI.csproj
+++ b/src/StardewModdingAPI/StardewModdingAPI.csproj
@@ -156,12 +156,10 @@
<Compile Include="Extensions.cs" />
<Compile Include="Framework\AssemblyRewriting\CachePaths.cs" />
<Compile Include="Framework\AssemblyRewriting\AssemblyTypeRewriter.cs" />
- <Compile Include="Framework\AssemblyRewriting\PlatformAssemblyMap.cs" />
<Compile Include="Framework\DeprecationLevel.cs" />
<Compile Include="Framework\DeprecationManager.cs" />
<Compile Include="Framework\InternalExtensions.cs" />
<Compile Include="Framework\ModAssemblyLoader.cs" />
- <Compile Include="Framework\Platform.cs" />
<Compile Include="IModHelper.cs" />
<Compile Include="Framework\LogFileManager.cs" />
<Compile Include="LogLevel.cs" />
@@ -218,6 +216,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\StardewModdingAPI.AssemblyRewriters\StardewModdingAPI.AssemblyRewriters.csproj">
+ <Project>{10db0676-9fc1-4771-a2c8-e2519f091e49}</Project>
+ <Name>StardewModdingAPI.AssemblyRewriters</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
@@ -243,6 +247,7 @@
</PropertyGroup>
<Target Name="AfterBuild" Condition="$(Configuration) == 'Debug' AND $(OS) == 'Windows_NT'">
<Copy SourceFiles="$(TargetDir)\$(TargetName).exe" DestinationFolder="$(GamePath)" />
+ <Copy SourceFiles="$(TargetDir)\StardewModdingAPI.AssemblyRewriters.dll" DestinationFolder="$(GamePath)" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).pdb" DestinationFolder="$(GamePath)" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).xml" DestinationFolder="$(GamePath)" />
<Copy SourceFiles="$(TargetDir)\Newtonsoft.Json.dll" DestinationFolder="$(GamePath)" />