summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Models
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 22:57:52 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 22:57:52 -0400
commitbf02c54f8bc4499052af8870e080100a4a7f05a3 (patch)
tree0b1242fa4a2c1f6465f1867b05e09c0161eb3336 /src/StardewModdingAPI/Framework/Models
parenta0e9fa9f3e2aa47c3fa98891f757509947d871d6 (diff)
parent2d9aefebb0991b2e942241bf509eaa98f63b4963 (diff)
downloadSMAPI-bf02c54f8bc4499052af8870e080100a4a7f05a3.tar.gz
SMAPI-bf02c54f8bc4499052af8870e080100a4a7f05a3.tar.bz2
SMAPI-bf02c54f8bc4499052af8870e080100a4a7f05a3.zip
Merge branch 'feature/285-mod-dependencies' into develop
# Conflicts: # src/StardewModdingAPI/Framework/ModRegistry.cs # src/StardewModdingAPI/Program.cs
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;
+ }
+ }
+}