From 125bcbee56bf40cf82abc7fdb502f8cbc18546cf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 13 Sep 2019 17:22:45 -0400 Subject: migrate to new project file format --- .../Framework/ModScanning/ModFolder.cs | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModFolder.cs') 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 -{ - /// The info about a mod read from its folder. - public class ModFolder - { - /********* - ** Accessors - *********/ - /// A suggested display name for the mod folder. - public string DisplayName { get; } - - /// The folder containing the mod's manifest.json. - public DirectoryInfo Directory { get; } - - /// The mod manifest. - public Manifest Manifest { get; } - - /// The error which occurred parsing the manifest, if any. - public string ManifestParseError { get; } - - /// Whether the mod should be loaded by default. This is false if it was found within a folder whose name starts with a dot. - public bool ShouldBeLoaded { get; } - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The root folder containing mods. - /// The folder containing the mod's manifest.json. - /// The mod manifest. - /// The error which occurred parsing the manifest, if any. - /// Whether the mod should be loaded by default. This should be false if it was found within a folder whose name starts with a dot. - 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); - } - - /// Get the update keys for a mod. - /// The mod manifest. - public IEnumerable GetUpdateKeys(Manifest manifest) - { - return - (manifest.UpdateKeys ?? new string[0]) - .Where(p => !string.IsNullOrWhiteSpace(p)) - .ToArray(); - } - } -} -- cgit