summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Models
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-12 01:15:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-13 15:33:35 -0400
commit3da27346c6886fff4afb35d7fb46345c92ef1197 (patch)
tree3ef0e46ce974cbbf0fd2ad83725fb146087f43e5 /src/StardewModdingAPI/Framework/Models
parent17ff230d8e7f7879337011babba4f65fae5d9bf8 (diff)
downloadSMAPI-3da27346c6886fff4afb35d7fb46345c92ef1197.tar.gz
SMAPI-3da27346c6886fff4afb35d7fb46345c92ef1197.tar.bz2
SMAPI-3da27346c6886fff4afb35d7fb46345c92ef1197.zip
add basic dependencies to manifest (#285)
Diffstat (limited to 'src/StardewModdingAPI/Framework/Models')
-rw-r--r--src/StardewModdingAPI/Framework/Models/Manifest.cs6
-rw-r--r--src/StardewModdingAPI/Framework/Models/ManifestDependency.cs23
2 files changed, 28 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/Models/Manifest.cs b/src/StardewModdingAPI/Framework/Models/Manifest.cs
index 79be2075..be781585 100644
--- a/src/StardewModdingAPI/Framework/Models/Manifest.cs
+++ b/src/StardewModdingAPI/Framework/Models/Manifest.cs
@@ -21,7 +21,7 @@ namespace StardewModdingAPI.Framework.Models
public string Author { get; set; }
/// <summary>The mod version.</summary>
- [JsonConverter(typeof(SemanticVersionConverter))]
+ [JsonConverter(typeof(ManifestFieldConverter))]
public ISemanticVersion Version { get; set; }
/// <summary>The minimum SMAPI version required by this mod, if any.</summary>
@@ -30,6 +30,10 @@ namespace StardewModdingAPI.Framework.Models
/// <summary>The name of the DLL in the directory that has the <see cref="Mod.Entry"/> method.</summary>
public string EntryDll { get; set; }
+ /// <summary>The other mods that must be loaded before this mod.</summary>
+ [JsonConverter(typeof(ManifestFieldConverter))]
+ public IManifestDependency[] Dependencies { get; set; }
+
/// <summary>The unique mod ID.</summary>
public string UniqueID { get; set; }
diff --git a/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs b/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs
new file mode 100644
index 00000000..2f580c1d
--- /dev/null
+++ b/src/StardewModdingAPI/Framework/Models/ManifestDependency.cs
@@ -0,0 +1,23 @@
+namespace StardewModdingAPI.Framework.Models
+{
+ /// <summary>A mod dependency listed in a mod manifest.</summary>
+ internal class ManifestDependency : IManifestDependency
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The unique mod ID to require.</summary>
+ public string UniqueID { get; set; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="uniqueID">The unique mod ID to require.</param>
+ public ManifestDependency(string uniqueID)
+ {
+ this.UniqueID = uniqueID;
+ }
+ }
+}