diff options
| author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-07 23:20:36 -0400 |
|---|---|---|
| committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-07 23:20:36 -0400 |
| commit | d0dd2f7ba729de6be749d326a2fed78988ba9d7b (patch) | |
| tree | a22127da6a8900e9f29bbb847bfd5d3347f6b952 /src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs | |
| parent | 7889676ea24cafc945899bf25608784e3f5bc9e0 (diff) | |
| parent | 5928f5f86c4493ddb6b89bce0b7d0fb73a884c09 (diff) | |
| download | SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.tar.gz SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.tar.bz2 SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.zip | |
Merge branch 'add-mod-build-config' into develop
Diffstat (limited to 'src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs')
| -rw-r--r-- | src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs b/src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs deleted file mode 100644 index 463f45e8..00000000 --- a/src/StardewModdingAPI/Framework/ModLoading/PlatformAssemblyMap.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Mono.Cecil; - -namespace StardewModdingAPI.Framework.ModLoading -{ - /// <summary>Metadata for mapping assemblies to the current <see cref="Platform"/>.</summary> - internal class PlatformAssemblyMap - { - /********* - ** Accessors - *********/ - /**** - ** Data - ****/ - /// <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; - - /**** - ** Metadata - ****/ - /// <summary>The assemblies to target. Equivalent types should be rewritten to use these assemblies.</summary> - public readonly Assembly[] Targets; - - /// <summary>An assembly => reference cache.</summary> - public readonly IDictionary<Assembly, AssemblyNameReference> TargetReferences; - - /// <summary>An assembly => module cache.</summary> - public readonly IDictionary<Assembly, ModuleDefinition> TargetModules; - - - /********* - ** 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) - { - // save data - this.TargetPlatform = targetPlatform; - this.RemoveNames = removeAssemblyNames; - - // cache assembly metadata - this.Targets = targetAssemblies; - this.TargetReferences = this.Targets.ToDictionary(assembly => assembly, assembly => AssemblyNameReference.Parse(assembly.FullName)); - this.TargetModules = this.Targets.ToDictionary(assembly => assembly, assembly => ModuleDefinition.ReadModule(assembly.Modules.Single().FullyQualifiedName)); - } - } -} |
