summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Models/ModGenericModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Web/Models/ModGenericModel.cs')
-rw-r--r--src/StardewModdingAPI.Web/Models/ModGenericModel.cs43
1 files changed, 37 insertions, 6 deletions
diff --git a/src/StardewModdingAPI.Web/Models/ModGenericModel.cs b/src/StardewModdingAPI.Web/Models/ModGenericModel.cs
index 208af416..dc36c7f4 100644
--- a/src/StardewModdingAPI.Web/Models/ModGenericModel.cs
+++ b/src/StardewModdingAPI.Web/Models/ModGenericModel.cs
@@ -7,21 +7,52 @@ namespace StardewModdingAPI.Web.Models
** Accessors
*********/
/// <summary>The unique mod ID.</summary>
- public int ID { get; set; }
+ public int ID { get; }
/// <summary>The mod name.</summary>
- public string Name { get; set; }
+ public string Name { get; }
/// <summary>The mod's vendor ID.</summary>
- public string Vendor { get; set; }
+ public string Vendor { get; }
/// <summary>The mod's semantic version number.</summary>
- public string Version { get; set; }
+ public string Version { get; }
/// <summary>The mod's web URL.</summary>
- public string Url { get; set; }
+ public string Url { get; }
/// <summary>Whether the mod is valid.</summary>
- public bool Valid { get; set; } = true;
+ public bool Valid { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct a valid instance.</summary>
+ /// <param name="vendor">The mod's vendor ID.</param>
+ /// <param name="id">The unique mod ID.</param>
+ /// <param name="name">The mod name.</param>
+ /// <param name="version">The mod's semantic version number.</param>
+ /// <param name="url">The mod's web URL.</param>
+ /// <param name="valid">Whether the mod is valid.</param>
+ public ModGenericModel(string vendor, int id, string name, string version, string url, bool valid = true)
+ {
+ this.Vendor = vendor;
+ this.ID = id;
+ this.Name = name;
+ this.Version = version;
+ this.Url = url;
+ this.Valid = valid;
+ }
+
+ /// <summary>Construct an valid instance.</summary>
+ /// <param name="vendor">The mod's vendor ID.</param>
+ /// <param name="id">The unique mod ID.</param>
+ public ModGenericModel(string vendor, int id)
+ {
+ this.Vendor = vendor;
+ this.ID = id;
+ this.Valid = false;
+ }
}
}