Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #197 from aspriddell/refactor-incorrect-name
Browse files Browse the repository at this point in the history
refactor incorrect name
  • Loading branch information
aspriddell authored Dec 12, 2020
2 parents 6e3aa38 + a4cca2a commit 5b8848c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

namespace DragonFruit.Six.API.Data.Deserializers
{
public static class StatsDeserializer
public static class GeneralStatsDeserializer
{
public static Stats 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;

if (json == null)
return null;

var result = new Stats
var result = new GeneralStats
{
Guid = guid,

Expand Down
10 changes: 5 additions & 5 deletions DragonFruit.Six.API/Data/Extensions/StatsExtentions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace DragonFruit.Six.API.Data.Extensions
public static class StatsExtentions
{
/// <summary>
/// Get the <see cref="Stats"/> (non-seasonal) for an <see cref="AccountInfo"/>
/// Get the <see cref="GeneralStats"/> (non-seasonal) for an <see cref="AccountInfo"/>
/// </summary>
public static Stats GetStats<T>(this T client, AccountInfo account, CancellationToken token = default) where T : Dragon6Client
public static GeneralStats GetStats<T>(this T client, AccountInfo account, CancellationToken token = default) where T : Dragon6Client
=> GetStats(client, new[] { account }, token).First();

/// <summary>
/// Get the <see cref="Stats"/> (non-seasonal) for an array of <see cref="AccountInfo"/>s
/// Get the <see cref="GeneralStats"/> (non-seasonal) for an array of <see cref="AccountInfo"/>s
/// </summary>
public static IEnumerable<Stats> GetStats<T>(this T client, IEnumerable<AccountInfo> accounts, CancellationToken token = default) where T : Dragon6Client
public static IEnumerable<GeneralStats> GetStats<T>(this T client, IEnumerable<AccountInfo> accounts, CancellationToken token = default) where T : Dragon6Client
{
var filteredGroups = accounts.GroupBy(x => x.Platform);

Expand All @@ -32,7 +32,7 @@ public static IEnumerable<Stats> GetStats<T>(this T client, IEnumerable<AccountI

foreach (var id in request.AccountIds)
{
yield return data.DeserializeStatsFor(id);
yield return data.DeserializeGeneralStatsFor(id);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace DragonFruit.Six.API.Data
{
public class Stats
public class GeneralStats
{
/// <summary>
/// Profile Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ namespace DragonFruit.Six.API.Data.Requests.Base
/// <summary>
/// Base for requesting general stats from the main endpoint
/// </summary>
public class StatsRequestBase : PlatformSpecificRequest
public class BasicStatsRequest : PlatformSpecificRequest
{
public override string Path => Platform.StatsEndpoint();

/// <summary>
/// Initialises a <see cref="StatsRequestBase"/> for a single <see cref="AccountInfo"/>
/// Initialises a <see cref="BasicStatsRequest"/> for a single <see cref="AccountInfo"/>
/// </summary>
public StatsRequestBase(AccountInfo account)
public BasicStatsRequest(AccountInfo account)
: base(new[] { account })
{
}

/// <summary>
/// Initialises a <see cref="StatsRequestBase"/> for an array of <see cref="AccountInfo"/>s
/// Initialises a <see cref="BasicStatsRequest"/> for an array of <see cref="AccountInfo"/>s
/// </summary>
public StatsRequestBase(IEnumerable<AccountInfo> accounts)
public BasicStatsRequest(IEnumerable<AccountInfo> accounts)
: base(accounts)
{
}
Expand Down
2 changes: 1 addition & 1 deletion DragonFruit.Six.API/Data/Requests/OperatorStatsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OperatorStats> operators)
: this(new[] { account }, operators)
Expand Down
2 changes: 1 addition & 1 deletion DragonFruit.Six.API/Data/Requests/StatsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace DragonFruit.Six.API.Data.Requests
{
public sealed class StatsRequest : StatsRequestBase
public sealed class StatsRequest : BasicStatsRequest
{
/// <summary>
/// Initialises a request for all the stats in <see cref="Stats"/> for the provided <see cref="AccountInfo"/>
Expand Down
2 changes: 1 addition & 1 deletion DragonFruit.Six.API/Data/Requests/WeaponStatsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b8848c

Please sign in to comment.