From 3beec0d042ccc6699ac09737af9457a03e4c05d9 Mon Sep 17 00:00:00 2001 From: abuZayed15 Date: Thu, 15 Oct 2020 12:04:31 -0400 Subject: [PATCH 1/3] added RankInfo backing field to return RankContainer Ranks or LegacyRanks --- DragonFruit.Six.API/Data/SeasonStats.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DragonFruit.Six.API/Data/SeasonStats.cs b/DragonFruit.Six.API/Data/SeasonStats.cs index 6256c71d..0c1c4bc0 100644 --- a/DragonFruit.Six.API/Data/SeasonStats.cs +++ b/DragonFruit.Six.API/Data/SeasonStats.cs @@ -2,6 +2,7 @@ // Licensed under Apache-2. Please refer to the LICENSE file for more info using System; +using DragonFruit.Six.API.Data.Containers; using DragonFruit.Six.API.Enums; using Newtonsoft.Json; @@ -77,5 +78,16 @@ public class SeasonStats [JsonProperty("last_match_skill_stdev_change")] public double LastMatchSkillUncertaintyChange { get; set; } + + [JsonProperty("rank_info")] + public RankContainer RankInfo + { + get + { + return Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); + } + + set => value ??= Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); + } } } From 10aeb0fbebb306b3d3eb7c16bfb6df5bc86aee7f Mon Sep 17 00:00:00 2001 From: abuZayed15 Date: Thu, 15 Oct 2020 12:17:14 -0400 Subject: [PATCH 2/3] added a private backing field and removed getters and setters on public property --- DragonFruit.Six.API/Data/SeasonStats.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/DragonFruit.Six.API/Data/SeasonStats.cs b/DragonFruit.Six.API/Data/SeasonStats.cs index 0c1c4bc0..3edc74fe 100644 --- a/DragonFruit.Six.API/Data/SeasonStats.cs +++ b/DragonFruit.Six.API/Data/SeasonStats.cs @@ -10,6 +10,8 @@ namespace DragonFruit.Six.API.Data { public class SeasonStats { + private RankContainer _rankInfo; + [JsonProperty("guid")] public string Guid { get; set; } @@ -79,15 +81,6 @@ public class SeasonStats [JsonProperty("last_match_skill_stdev_change")] public double LastMatchSkillUncertaintyChange { get; set; } - [JsonProperty("rank_info")] - public RankContainer RankInfo - { - get - { - return Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); - } - - set => value ??= Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); - } + public RankContainer RankInfo => _rankInfo ??= Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); } } From 377f1425e3d0939c85d30065c3a9db706a7d529d Mon Sep 17 00:00:00 2001 From: Albie Date: Thu, 15 Oct 2020 17:19:25 +0100 Subject: [PATCH 3/3] change season id --- DragonFruit.Six.API/Data/SeasonStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DragonFruit.Six.API/Data/SeasonStats.cs b/DragonFruit.Six.API/Data/SeasonStats.cs index 3edc74fe..7e97d1b7 100644 --- a/DragonFruit.Six.API/Data/SeasonStats.cs +++ b/DragonFruit.Six.API/Data/SeasonStats.cs @@ -81,6 +81,6 @@ public class SeasonStats [JsonProperty("last_match_skill_stdev_change")] public double LastMatchSkillUncertaintyChange { get; set; } - public RankContainer RankInfo => _rankInfo ??= Rank > 16 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); + public RankContainer RankInfo => _rankInfo ??= Rank > 14 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank); } }