diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-07 23:20:36 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-07 23:20:36 -0400 |
commit | d0dd2f7ba729de6be749d326a2fed78988ba9d7b (patch) | |
tree | a22127da6a8900e9f29bbb847bfd5d3347f6b952 /src/SMAPI.Models | |
parent | 7889676ea24cafc945899bf25608784e3f5bc9e0 (diff) | |
parent | 5928f5f86c4493ddb6b89bce0b7d0fb73a884c09 (diff) | |
download | SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.tar.gz SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.tar.bz2 SMAPI-d0dd2f7ba729de6be749d326a2fed78988ba9d7b.zip |
Merge branch 'add-mod-build-config' into develop
Diffstat (limited to 'src/SMAPI.Models')
-rw-r--r-- | src/SMAPI.Models/ModInfoModel.cs | 48 | ||||
-rw-r--r-- | src/SMAPI.Models/ModSeachModel.cs | 30 | ||||
-rw-r--r-- | src/SMAPI.Models/StardewModdingAPI.Models.projitems | 15 | ||||
-rw-r--r-- | src/SMAPI.Models/StardewModdingAPI.Models.shproj | 13 |
4 files changed, 106 insertions, 0 deletions
diff --git a/src/SMAPI.Models/ModInfoModel.cs b/src/SMAPI.Models/ModInfoModel.cs new file mode 100644 index 00000000..44071230 --- /dev/null +++ b/src/SMAPI.Models/ModInfoModel.cs @@ -0,0 +1,48 @@ +using Newtonsoft.Json; + +namespace StardewModdingAPI.Models +{ + /// <summary>Generic metadata about a mod.</summary> + internal class ModInfoModel + { + /********* + ** Accessors + *********/ + /// <summary>The mod name.</summary> + public string Name { get; } + + /// <summary>The mod's semantic version number.</summary> + public string Version { get; } + + /// <summary>The mod's web URL.</summary> + public string Url { get; } + + /// <summary>The error message indicating why the mod is invalid (if applicable).</summary> + public string Error { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct a valid instance.</summary> + /// <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="error">The error message indicating why the mod is invalid (if applicable).</param> + [JsonConstructor] + public ModInfoModel(string name, string version, string url, string error = null) + { + this.Name = name; + this.Version = version; + this.Url = url; + this.Error = error; // mainly initialised here for the JSON deserialiser + } + + /// <summary>Construct an valid instance.</summary> + /// <param name="error">The error message indicating why the mod is invalid.</param> + public ModInfoModel(string error) + { + this.Error = error; + } + } +} diff --git a/src/SMAPI.Models/ModSeachModel.cs b/src/SMAPI.Models/ModSeachModel.cs new file mode 100644 index 00000000..526fbaf3 --- /dev/null +++ b/src/SMAPI.Models/ModSeachModel.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using System.Linq; + +namespace StardewModdingAPI.Models +{ + /// <summary>Specifies mods whose update-check info to fetch.</summary> + internal class ModSearchModel + { + /********* + ** Accessors + *********/ + /// <summary>The namespaced mod keys to search.</summary> + public string[] ModKeys { get; set; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an empty instance.</summary> + /// <remarks>This constructed is needed for JSON deserialisation.</remarks> + public ModSearchModel() { } + + /// <summary>Construct an valid instance.</summary> + /// <param name="modKeys">The namespaced mod keys to search.</param> + public ModSearchModel(IEnumerable<string> modKeys) + { + this.ModKeys = modKeys.ToArray(); + } + } +} diff --git a/src/SMAPI.Models/StardewModdingAPI.Models.projitems b/src/SMAPI.Models/StardewModdingAPI.Models.projitems new file mode 100644 index 00000000..e2cb29e1 --- /dev/null +++ b/src/SMAPI.Models/StardewModdingAPI.Models.projitems @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <SharedGUID>2aa02fb6-ff03-41cf-a215-2ee60ab4f5dc</SharedGUID> + </PropertyGroup> + <PropertyGroup Label="Configuration"> + <Import_RootNamespace>StardewModdingAPI.Models</Import_RootNamespace> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildThisFileDirectory)ModSeachModel.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)ModInfoModel.cs" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/src/SMAPI.Models/StardewModdingAPI.Models.shproj b/src/SMAPI.Models/StardewModdingAPI.Models.shproj new file mode 100644 index 00000000..c80517af --- /dev/null +++ b/src/SMAPI.Models/StardewModdingAPI.Models.shproj @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="Globals"> + <ProjectGuid>2aa02fb6-ff03-41cf-a215-2ee60ab4f5dc</ProjectGuid> + <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> + <PropertyGroup /> + <Import Project="StardewModdingAPI.Models.projitems" Label="Shared" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> +</Project> |