From 694a199fa2166ac1bcf63f17888d9eba51a3a0b4 Mon Sep 17 00:00:00 2001 From: Albie Date: Sat, 12 Dec 2020 07:17:56 +0000 Subject: [PATCH 1/2] refactor incorrect name --- .../Data/Deserializers/StatsDeserializer.cs | 4 ++-- DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs | 8 ++++---- DragonFruit.Six.API/Data/{Stats.cs => GeneralStats.cs} | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename DragonFruit.Six.API/Data/{Stats.cs => GeneralStats.cs} (99%) diff --git a/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs b/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs index a11458ac..6f9d8430 100644 --- a/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs +++ b/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs @@ -11,7 +11,7 @@ namespace DragonFruit.Six.API.Data.Deserializers { public static class StatsDeserializer { - public static Stats DeserializeStatsFor(this JObject jObject, string guid) + public static GeneralStats DeserializeStatsFor(this JObject jObject, string guid) { // try to get the user but if there is nothing return null var json = jObject[Misc.Results]?[guid] as JObject; @@ -19,7 +19,7 @@ public static Stats DeserializeStatsFor(this JObject jObject, string guid) if (json == null) return null; - var result = new Stats + var result = new GeneralStats { Guid = guid, diff --git a/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs b/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs index a55e777a..f352d5f0 100644 --- a/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs +++ b/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs @@ -13,15 +13,15 @@ namespace DragonFruit.Six.API.Data.Extensions public static class StatsExtentions { /// - /// Get the (non-seasonal) for an + /// Get the (non-seasonal) for an /// - public static Stats GetStats(this T client, AccountInfo account, CancellationToken token = default) where T : Dragon6Client + public static GeneralStats GetStats(this T client, AccountInfo account, CancellationToken token = default) where T : Dragon6Client => GetStats(client, new[] { account }, token).First(); /// - /// Get the (non-seasonal) for an array of s + /// Get the (non-seasonal) for an array of s /// - public static IEnumerable GetStats(this T client, IEnumerable accounts, CancellationToken token = default) where T : Dragon6Client + public static IEnumerable GetStats(this T client, IEnumerable accounts, CancellationToken token = default) where T : Dragon6Client { var filteredGroups = accounts.GroupBy(x => x.Platform); diff --git a/DragonFruit.Six.API/Data/Stats.cs b/DragonFruit.Six.API/Data/GeneralStats.cs similarity index 99% rename from DragonFruit.Six.API/Data/Stats.cs rename to DragonFruit.Six.API/Data/GeneralStats.cs index 2736dfda..b66a6ea6 100644 --- a/DragonFruit.Six.API/Data/Stats.cs +++ b/DragonFruit.Six.API/Data/GeneralStats.cs @@ -6,7 +6,7 @@ namespace DragonFruit.Six.API.Data { - public class Stats + public class GeneralStats { /// /// Profile Id From a4cca2a81b2a4f06ec2f55708ed143db52572054 Mon Sep 17 00:00:00 2001 From: Albie Date: Sat, 12 Dec 2020 07:28:54 +0000 Subject: [PATCH 2/2] fix more incorrect names --- ...tatsDeserializer.cs => GeneralStatsDeserializer.cs} | 4 ++-- DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs | 2 +- .../Base/{StatsRequestBase.cs => BasicStatsRequest.cs} | 10 +++++----- .../Data/Requests/OperatorStatsRequest.cs | 2 +- DragonFruit.Six.API/Data/Requests/StatsRequest.cs | 2 +- .../Data/Requests/WeaponStatsRequest.cs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename DragonFruit.Six.API/Data/Deserializers/{StatsDeserializer.cs => GeneralStatsDeserializer.cs} (97%) rename DragonFruit.Six.API/Data/Requests/Base/{StatsRequestBase.cs => BasicStatsRequest.cs} (75%) diff --git a/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs b/DragonFruit.Six.API/Data/Deserializers/GeneralStatsDeserializer.cs similarity index 97% rename from DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs rename to DragonFruit.Six.API/Data/Deserializers/GeneralStatsDeserializer.cs index 6f9d8430..34b1c4cf 100644 --- a/DragonFruit.Six.API/Data/Deserializers/StatsDeserializer.cs +++ b/DragonFruit.Six.API/Data/Deserializers/GeneralStatsDeserializer.cs @@ -9,9 +9,9 @@ namespace DragonFruit.Six.API.Data.Deserializers { - public static class StatsDeserializer + public static class GeneralStatsDeserializer { - public static GeneralStats DeserializeStatsFor(this JObject jObject, string guid) + public static GeneralStats DeserializeGeneralStatsFor(this JObject jObject, string guid) { // try to get the user but if there is nothing return null var json = jObject[Misc.Results]?[guid] as JObject; diff --git a/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs b/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs index f352d5f0..d4ef702d 100644 --- a/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs +++ b/DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs @@ -32,7 +32,7 @@ public static IEnumerable GetStats(this T client, IEnumerable /// Base for requesting general stats from the main endpoint /// - public class StatsRequestBase : PlatformSpecificRequest + public class BasicStatsRequest : PlatformSpecificRequest { public override string Path => Platform.StatsEndpoint(); /// - /// Initialises a for a single + /// Initialises a for a single /// - public StatsRequestBase(AccountInfo account) + public BasicStatsRequest(AccountInfo account) : base(new[] { account }) { } /// - /// Initialises a for an array of s + /// Initialises a for an array of s /// - public StatsRequestBase(IEnumerable accounts) + public BasicStatsRequest(IEnumerable accounts) : base(accounts) { } diff --git a/DragonFruit.Six.API/Data/Requests/OperatorStatsRequest.cs b/DragonFruit.Six.API/Data/Requests/OperatorStatsRequest.cs index 4f38b39a..7f123bbd 100644 --- a/DragonFruit.Six.API/Data/Requests/OperatorStatsRequest.cs +++ b/DragonFruit.Six.API/Data/Requests/OperatorStatsRequest.cs @@ -8,7 +8,7 @@ namespace DragonFruit.Six.API.Data.Requests { - public sealed class OperatorStatsRequest : StatsRequestBase + public sealed class OperatorStatsRequest : BasicStatsRequest { public OperatorStatsRequest(AccountInfo account, IEnumerable operators) : this(new[] { account }, operators) diff --git a/DragonFruit.Six.API/Data/Requests/StatsRequest.cs b/DragonFruit.Six.API/Data/Requests/StatsRequest.cs index 75c8cbd8..5a4dce6b 100644 --- a/DragonFruit.Six.API/Data/Requests/StatsRequest.cs +++ b/DragonFruit.Six.API/Data/Requests/StatsRequest.cs @@ -7,7 +7,7 @@ namespace DragonFruit.Six.API.Data.Requests { - public sealed class StatsRequest : StatsRequestBase + public sealed class StatsRequest : BasicStatsRequest { /// /// Initialises a request for all the stats in for the provided diff --git a/DragonFruit.Six.API/Data/Requests/WeaponStatsRequest.cs b/DragonFruit.Six.API/Data/Requests/WeaponStatsRequest.cs index c69e10b1..df5bb1f0 100644 --- a/DragonFruit.Six.API/Data/Requests/WeaponStatsRequest.cs +++ b/DragonFruit.Six.API/Data/Requests/WeaponStatsRequest.cs @@ -7,7 +7,7 @@ namespace DragonFruit.Six.API.Data.Requests { - public sealed class WeaponStatsRequest : StatsRequestBase + public sealed class WeaponStatsRequest : BasicStatsRequest { public WeaponStatsRequest(AccountInfo account) : base(account)