From 9791de306c22c744732219dadfd97b7dd556a5b2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 21 Sep 2017 23:35:18 -0400 Subject: minor cleanup, formatting, documentation (#336) --- Dewdrop/Models/IModModel.cs | 18 ++++++-------- Dewdrop/Models/ModGenericModel.cs | 37 +++++++++------------------- Dewdrop/Models/NexusResponseModel.cs | 47 +++++++++++++++--------------------- 3 files changed, 39 insertions(+), 63 deletions(-) (limited to 'Dewdrop/Models') 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 + /// A mod metadata response which provides a method to extract generic info. + internal interface IModModel { - /// - /// Basic information in the form of - /// - /// + /********* + ** Public methods + *********/ + /// Get basic mod metadata. 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 { + /// Generic metadata about a mod. public class ModGenericModel { - /// - /// An identifier for the mod. - /// - public int Id { get; set; } + /********* + ** Accessors + *********/ + /// The unique mod ID. + public int ID { get; set; } - /// - /// The mod's name. - /// + /// The mod name. public string Name { get; set; } - /// - /// The vendor identifier for the mod. - /// + /// The mod's vendor ID. public string Vendor { get; set; } - /// - /// The mod's version number. - /// + /// The mod's semantic version number. public string Version { get; set; } - /// - /// The mod's URL - /// + /// The mod's web URL. public string Url { get; set; } - /// - /// Is the mod a valid mod. - /// + /// Whether the mod is valid. 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 { + /// A mod metadata response from Nexus Mods. public class NexusResponseModel : IModModel { - /// - /// The name of the mod. - /// - [JsonProperty("name")] + /********* + ** Accessors + *********/ + /// The unique mod ID. + public int ID { get; set; } + + /// The mod name. public string Name { get; set; } - /// - /// The version of the mod. - /// - [JsonProperty("version")] + /// The mod's semantic version number. public string Version { get; set; } - /// - /// The NexusMod ID for the mod. - /// - [JsonProperty("id")] - public int Id { get; set; } - - /// - /// The URL of the mod. - /// + /// The mod's web URL. [JsonProperty("mod_page_uri")] public string Url { get; set; } - /// - /// Return mod information about a Nexus mod - /// - /// + + /********* + ** Public methods + *********/ + /// Get basic mod metadata. 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" }; } -- cgit