summaryrefslogtreecommitdiff
path: root/Dewdrop/Models
diff options
context:
space:
mode:
Diffstat (limited to 'Dewdrop/Models')
-rw-r--r--Dewdrop/Models/IModModel.cs18
-rw-r--r--Dewdrop/Models/ModGenericModel.cs37
-rw-r--r--Dewdrop/Models/NexusResponseModel.cs47
3 files changed, 39 insertions, 63 deletions
diff --git a/Dewdrop/Models/IModModel.cs b/Dewdrop/Models/IModModel.cs
index aa6583d4..f1b09f8a 100644
--- a/Dewdrop/Models/IModModel.cs
+++ b/Dewdrop/Models/IModModel.cs
@@ -1,16 +1,12 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Dewdrop.Models
+namespace Dewdrop.Models
{
- interface IModModel
+ /// <summary>A mod metadata response which provides a method to extract generic info.</summary>
+ internal interface IModModel
{
- /// <summary>
- /// Basic information in the form of <see cref="ModGenericModel"/>
- /// </summary>
- /// <returns><see cref="ModGenericModel"/></returns>
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Get basic mod metadata.</summary>
ModGenericModel ModInfo();
}
}
diff --git a/Dewdrop/Models/ModGenericModel.cs b/Dewdrop/Models/ModGenericModel.cs
index 829c396a..0da04295 100644
--- a/Dewdrop/Models/ModGenericModel.cs
+++ b/Dewdrop/Models/ModGenericModel.cs
@@ -1,40 +1,27 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Dewdrop.Models
+namespace Dewdrop.Models
{
+ /// <summary>Generic metadata about a mod.</summary>
public class ModGenericModel
{
- /// <summary>
- /// An identifier for the mod.
- /// </summary>
- public int Id { get; set; }
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The unique mod ID.</summary>
+ public int ID { get; set; }
- /// <summary>
- /// The mod's name.
- /// </summary>
+ /// <summary>The mod name.</summary>
public string Name { get; set; }
- /// <summary>
- /// The vendor identifier for the mod.
- /// </summary>
+ /// <summary>The mod's vendor ID.</summary>
public string Vendor { get; set; }
- /// <summary>
- /// The mod's version number.
- /// </summary>
+ /// <summary>The mod's semantic version number.</summary>
public string Version { get; set; }
- /// <summary>
- /// The mod's URL
- /// </summary>
+ /// <summary>The mod's web URL.</summary>
public string Url { get; set; }
- /// <summary>
- /// Is the mod a valid mod.
- /// </summary>
+ /// <summary>Whether the mod is valid.</summary>
public bool Valid { get; set; } = true;
}
}
diff --git a/Dewdrop/Models/NexusResponseModel.cs b/Dewdrop/Models/NexusResponseModel.cs
index e954a8bc..fa663910 100644
--- a/Dewdrop/Models/NexusResponseModel.cs
+++ b/Dewdrop/Models/NexusResponseModel.cs
@@ -1,46 +1,39 @@
-using System;
-using Newtonsoft.Json;
+using Newtonsoft.Json;
namespace Dewdrop.Models
{
+ /// <summary>A mod metadata response from Nexus Mods.</summary>
public class NexusResponseModel : IModModel
{
- /// <summary>
- /// The name of the mod.
- /// </summary>
- [JsonProperty("name")]
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The unique mod ID.</summary>
+ public int ID { get; set; }
+
+ /// <summary>The mod name.</summary>
public string Name { get; set; }
- /// <summary>
- /// The version of the mod.
- /// </summary>
- [JsonProperty("version")]
+ /// <summary>The mod's semantic version number.</summary>
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>
+ /// <summary>The mod's web URL.</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 methods
+ *********/
+ /// <summary>Get basic mod metadata.</summary>
public ModGenericModel ModInfo()
{
return new ModGenericModel
{
- Id = Id,
- Version = Version,
- Name = Name,
- Url = Url,
+ ID = this.ID,
+ Version = this.Version,
+ Name = this.Name,
+ Url = this.Url,
Vendor = "Nexus"
};
}