diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-13 17:22:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-13 17:22:45 -0400 |
commit | 125bcbee56bf40cf82abc7fdb502f8cbc18546cf (patch) | |
tree | 788997dd4683867b6e32e307c17c855bd7209d98 /src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs | |
parent | 56726073ba65a018312bcd9db7072381073de315 (diff) | |
download | SMAPI-125bcbee56bf40cf82abc7fdb502f8cbc18546cf.tar.gz SMAPI-125bcbee56bf40cf82abc7fdb502f8cbc18546cf.tar.bz2 SMAPI-125bcbee56bf40cf82abc7fdb502f8cbc18546cf.zip |
migrate to new project file format
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs deleted file mode 100644 index bb467b36..00000000 --- a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using StardewModdingAPI.Toolkit.Serialisation.Models; -using StardewModdingAPI.Toolkit.Utilities; - -namespace StardewModdingAPI.Toolkit.Framework.ModScanning -{ - /// <summary>The info about a mod read from its folder.</summary> - public class ModFolder - { - /********* - ** Accessors - *********/ - /// <summary>A suggested display name for the mod folder.</summary> - public string DisplayName { get; } - - /// <summary>The folder containing the mod's manifest.json.</summary> - public DirectoryInfo Directory { get; } - - /// <summary>The mod manifest.</summary> - public Manifest Manifest { get; } - - /// <summary>The error which occurred parsing the manifest, if any.</summary> - public string ManifestParseError { get; } - - /// <summary>Whether the mod should be loaded by default. This is <c>false</c> if it was found within a folder whose name starts with a dot.</summary> - public bool ShouldBeLoaded { get; } - - - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="root">The root folder containing mods.</param> - /// <param name="directory">The folder containing the mod's manifest.json.</param> - /// <param name="manifest">The mod manifest.</param> - /// <param name="manifestParseError">The error which occurred parsing the manifest, if any.</param> - /// <param name="shouldBeLoaded">Whether the mod should be loaded by default. This should be <c>false</c> if it was found within a folder whose name starts with a dot.</param> - public ModFolder(DirectoryInfo root, DirectoryInfo directory, Manifest manifest, string manifestParseError = null, bool shouldBeLoaded = true) - { - // save info - this.Directory = directory; - this.Manifest = manifest; - this.ManifestParseError = manifestParseError; - this.ShouldBeLoaded = shouldBeLoaded; - - // set display name - this.DisplayName = manifest?.Name; - if (string.IsNullOrWhiteSpace(this.DisplayName)) - this.DisplayName = PathUtilities.GetRelativePath(root.FullName, directory.FullName); - } - - /// <summary>Get the update keys for a mod.</summary> - /// <param name="manifest">The mod manifest.</param> - public IEnumerable<string> GetUpdateKeys(Manifest manifest) - { - return - (manifest.UpdateKeys ?? new string[0]) - .Where(p => !string.IsNullOrWhiteSpace(p)) - .ToArray(); - } - } -} |