diff options
Diffstat (limited to 'Dewdrop/Models')
-rw-r--r-- | Dewdrop/Models/IModModel.cs | 16 | ||||
-rw-r--r-- | Dewdrop/Models/ModGenericModel.cs | 40 | ||||
-rw-r--r-- | Dewdrop/Models/NexusResponseModel.cs | 48 |
3 files changed, 104 insertions, 0 deletions
diff --git a/Dewdrop/Models/IModModel.cs b/Dewdrop/Models/IModModel.cs new file mode 100644 index 00000000..aa6583d4 --- /dev/null +++ b/Dewdrop/Models/IModModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Dewdrop.Models +{ + interface IModModel + { + /// <summary> + /// Basic information in the form of <see cref="ModGenericModel"/> + /// </summary> + /// <returns><see cref="ModGenericModel"/></returns> + ModGenericModel ModInfo(); + } +} diff --git a/Dewdrop/Models/ModGenericModel.cs b/Dewdrop/Models/ModGenericModel.cs new file mode 100644 index 00000000..829c396a --- /dev/null +++ b/Dewdrop/Models/ModGenericModel.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Dewdrop.Models +{ + public class ModGenericModel + { + /// <summary> + /// An identifier for the mod. + /// </summary> + public int Id { get; set; } + + /// <summary> + /// The mod's name. + /// </summary> + public string Name { get; set; } + + /// <summary> + /// The vendor identifier for the mod. + /// </summary> + public string Vendor { get; set; } + + /// <summary> + /// The mod's version number. + /// </summary> + public string Version { get; set; } + + /// <summary> + /// The mod's URL + /// </summary> + public string Url { get; set; } + + /// <summary> + /// Is the mod a valid mod. + /// </summary> + public bool Valid { get; set; } = true; + } +} diff --git a/Dewdrop/Models/NexusResponseModel.cs b/Dewdrop/Models/NexusResponseModel.cs new file mode 100644 index 00000000..e954a8bc --- /dev/null +++ b/Dewdrop/Models/NexusResponseModel.cs @@ -0,0 +1,48 @@ +using System; +using Newtonsoft.Json; + +namespace Dewdrop.Models +{ + public class NexusResponseModel : IModModel + { + /// <summary> + /// The name of the mod. + /// </summary> + [JsonProperty("name")] + public string Name { get; set; } + + /// <summary> + /// The version of the mod. + /// </summary> + [JsonProperty("version")] + public string Version { get; set; } + + /// <summary> + /// The NexusMod ID for the mod. + /// </summary> + [JsonProperty("id")] + public int Id { get; set; } + + /// <summary> + /// The URL of the mod. + /// </summary> + [JsonProperty("mod_page_uri")] + public string Url { get; set; } + + /// <summary> + /// Return mod information about a Nexus mod + /// </summary> + /// <returns><see cref="ModGenericModel"/></returns> + public ModGenericModel ModInfo() + { + return new ModGenericModel + { + Id = Id, + Version = Version, + Name = Name, + Url = Url, + Vendor = "Nexus" + }; + } + } +} |