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

added RankInfo backing field to return RankContainer Ranks or LegacyR… #123

Merged
merged 3 commits into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DragonFruit.Six.API/Data/SeasonStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
// 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;

namespace DragonFruit.Six.API.Data
{
public class SeasonStats
{
private RankContainer _rankInfo;

[JsonProperty("guid")]
public string Guid { get; set; }

Expand Down Expand Up @@ -77,5 +80,7 @@ public class SeasonStats

[JsonProperty("last_match_skill_stdev_change")]
public double LastMatchSkillUncertaintyChange { get; set; }

public RankContainer RankInfo => _rankInfo ??= Rank > 14 ? References.Ranks((int)Rank) : References.LegacyRanks((int)Rank);
}
}