summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/ModToolkit.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-02 17:54:01 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-02 17:54:01 -0400
commitb6cda8f0d32898f34b5c7dc703a85aa823c317ce (patch)
tree91d95583b6af5ce842a3d8208aacb225bdd822d6 /src/StardewModdingAPI.Toolkit/ModToolkit.cs
parent2e3c42130358734a6fcf547745324dd272176f9c (diff)
parent9945408aa4ea2f6e07c2820f6aa1c160c68423d5 (diff)
downloadSMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.tar.gz
SMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.tar.bz2
SMAPI-b6cda8f0d32898f34b5c7dc703a85aa823c317ce.zip
Merge branch 'create-toolkit' into develop
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/ModToolkit.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/ModToolkit.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/ModToolkit.cs b/src/StardewModdingAPI.Toolkit/ModToolkit.cs
new file mode 100644
index 00000000..6136186e
--- /dev/null
+++ b/src/StardewModdingAPI.Toolkit/ModToolkit.cs
@@ -0,0 +1,33 @@
+using System.Threading.Tasks;
+using StardewModdingAPI.Toolkit.Framework.Clients.Wiki;
+
+namespace StardewModdingAPI.Toolkit
+{
+ /// <summary>A convenience wrapper for the various tools.</summary>
+ public class ModToolkit
+ {
+ /*********
+ ** Properties
+ *********/
+ /// <summary>The default HTTP user agent for the toolkit.</summary>
+ private readonly string UserAgent;
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ public ModToolkit()
+ {
+ ISemanticVersion version = new SemanticVersion(this.GetType().Assembly.GetName().Version);
+ this.UserAgent = $"SMAPI Mod Handler Toolkit/{version}";
+ }
+
+ /// <summary>Extract mod metadata from the wiki compatibility list.</summary>
+ public async Task<WikiCompatibilityEntry[]> GetWikiCompatibilityListAsync()
+ {
+ var client = new WikiCompatibilityClient(this.UserAgent);
+ return await client.FetchAsync();
+ }
+ }
+}