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 #121 from abuZayed15/issue-110
Browse files Browse the repository at this point in the history
converted Dictionaries into one function that returns an object of Ra…
  • Loading branch information
aspriddell authored Oct 14, 2020
2 parents 46a45a4 + 47fbaab commit 9403f2e
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions DragonFruit.Six.API/References.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,69 +27,69 @@ public static readonly IReadOnlyDictionary<byte, string> WeaponClasses
[9] = "Launcher"
};

public static readonly IEnumerable<RankContainer> Ranks = new RankContainer[]
public static RankContainer Ranks(int rank) => rank switch
{
new RankContainer(0, "Unranked", "/rank/v2/0.svg"),

new RankContainer(1, "Copper 5", "/rank/v2/1.svg"),
new RankContainer(2, "Copper 4", "/rank/v2/2.svg"),
new RankContainer(3, "Copper 3", "/rank/v2/3.svg"),
new RankContainer(4, "Copper 2", "/rank/v2/4.svg"),
new RankContainer(5, "Copper 1", "/rank/v2/5.svg"),

new RankContainer(6, "Bronze 5", "/rank/v2/6.svg"),
new RankContainer(7, "Bronze 4", "/rank/v2/7.svg"),
new RankContainer(8, "Bronze 3", "/rank/v2/8.svg"),
new RankContainer(9, "Bronze 2", "/rank/v2/9.svg"),
new RankContainer(10, "Bronze 1", "/rank/v2/10.svg"),

new RankContainer(11, "Silver 5", "/rank/v2/11.svg"),
new RankContainer(12, "Silver 4", "/rank/v2/12.svg"),
new RankContainer(13, "Silver 3", "/rank/v2/13.svg"),
new RankContainer(14, "Silver 2", "/rank/v2/14.svg"),
new RankContainer(15, "Silver 1", "/rank/v2/15.svg"),

new RankContainer(16, "Gold 3", "/rank/v2/16.svg"),
new RankContainer(17, "Gold 2", "/rank/v2/17.svg"),
new RankContainer(18, "Gold 1", "/rank/v2/18.svg"),

new RankContainer(19, "Platinum 3", "/rank/v2/19.svg"),
new RankContainer(20, "Platinum 2", "/rank/v2/20.svg"),
new RankContainer(21, "Platinum 1", "/rank/v2/21.svg"),

new RankContainer(22, "Diamond", "/rank/v2/22.svg"),
new RankContainer(23, "Champion", "/rank/v2/23.svg"),
1 => new RankContainer(1, "Copper 5", "/rank/v2/1.svg"),
2 => new RankContainer(2, "Copper 4", "/rank/v2/2.svg"),
3 => new RankContainer(3, "Copper 3", "/rank/v2/3.svg"),
4 => new RankContainer(4, "Copper 2", "/rank/v2/4.svg"),
5 => new RankContainer(5, "Copper 1", "/rank/v2/5.svg"),

6 => new RankContainer(6, "Bronze 5", "/rank/v2/6.svg"),
7 => new RankContainer(7, "Bronze 4", "/rank/v2/7.svg"),
8 => new RankContainer(8, "Bronze 3", "/rank/v2/8.svg"),
9 => new RankContainer(9, "Bronze 2", "/rank/v2/9.svg"),
10 => new RankContainer(10, "Bronze 1", "/rank/v2/10.svg"),

11 => new RankContainer(11, "Silver 5", "/rank/v2/11.svg"),
12 => new RankContainer(12, "Silver 4", "/rank/v2/12.svg"),
13 => new RankContainer(13, "Silver 3", "/rank/v2/13.svg"),
14 => new RankContainer(14, "Silver 2", "/rank/v2/14.svg"),
15 => new RankContainer(15, "Silver 1", "/rank/v2/15.svg"),

16 => new RankContainer(16, "Gold 3", "/rank/v2/16.svg"),
17 => new RankContainer(17, "Gold 2", "/rank/v2/17.svg"),
18 => new RankContainer(18, "Gold 1", "/rank/v2/18.svg"),

19 => new RankContainer(19, "Platinum 3", "/rank/v2/19.svg"),
20 => new RankContainer(20, "Platinum 2", "/rank/v2/20.svg"),
21 => new RankContainer(21, "Platinum 1", "/rank/v2/21.svg"),

22 => new RankContainer(22, "Diamond", "/rank/v2/22.svg"),
23 => new RankContainer(23, "Champion", "/rank/v2/23.svg"),

_ => new RankContainer(0, "Unranked", "/rank/v2/0.svg")
};

public static readonly IEnumerable<RankContainer> LegacyRanks = new RankContainer[]
public static RankContainer LegacyRanks(int legacyRank) => legacyRank switch
{
new RankContainer(0, "Unranked", "/rank/v1/0.svg"),
1 => new RankContainer(1, "Copper 4", "/rank/v1/1.svg"),
2 => new RankContainer(2, "Copper 3", "/rank/v1/2.svg"),
3 => new RankContainer(3, "Copper 2", "/rank/v1/3.svg"),
4 => new RankContainer(4, "Copper 1", "/rank/v1/4.svg"),

new RankContainer(1, "Copper 4", "/rank/v1/1.svg"),
new RankContainer(2, "Copper 3", "/rank/v1/2.svg"),
new RankContainer(3, "Copper 2", "/rank/v1/3.svg"),
new RankContainer(4, "Copper 1", "/rank/v1/4.svg"),
5 => new RankContainer(5, "Bronze 4", "/rank/v1/5.svg"),
6 => new RankContainer(6, "Bronze 3", "/rank/v1/6.svg"),
7 => new RankContainer(7, "Bronze 2", "/rank/v1/7.svg"),
8 => new RankContainer(8, "Bronze 1", "/rank/v1/8.svg"),

new RankContainer(5, "Bronze 4", "/rank/v1/5.svg"),
new RankContainer(6, "Bronze 3", "/rank/v1/6.svg"),
new RankContainer(7, "Bronze 2", "/rank/v1/7.svg"),
new RankContainer(8, "Bronze 1", "/rank/v1/8.svg"),
9 => new RankContainer(9, "Silver 4", "/rank/v1/9.svg"),
10 => new RankContainer(10, "Silver 3", "/rank/v1/10.svg"),
11 => new RankContainer(11, "Silver 2", "/rank/v1/11.svg"),
12 => new RankContainer(12, "Silver 1", "/rank/v1/12.svg"),

new RankContainer(9, "Silver 4", "/rank/v1/9.svg"),
new RankContainer(10, "Silver 3", "/rank/v1/10.svg"),
new RankContainer(11, "Silver 2", "/rank/v1/11.svg"),
new RankContainer(12, "Silver 1", "/rank/v1/12.svg"),
13 => new RankContainer(13, "Gold 4", "/rank/v1/13.svg"),
14 => new RankContainer(14, "Gold 3", "/rank/v1/14.svg"),
15 => new RankContainer(15, "Gold 2", "/rank/v1/15.svg"),
16 => new RankContainer(16, "Gold 1", "/rank/v1/16.svg"),

new RankContainer(13, "Gold 4", "/rank/v1/13.svg"),
new RankContainer(14, "Gold 3", "/rank/v1/14.svg"),
new RankContainer(15, "Gold 2", "/rank/v1/15.svg"),
new RankContainer(16, "Gold 1", "/rank/v1/16.svg"),
17 => new RankContainer(17, "Platinum 3", "/rank/v1/17.svg"),
18 => new RankContainer(18, "Platinum 2", "/rank/v1/18.svg"),
19 => new RankContainer(19, "Platinum 1", "/rank/v1/19.svg"),

new RankContainer(17, "Platinum 3", "/rank/v1/17.svg"),
new RankContainer(18, "Platinum 2", "/rank/v1/18.svg"),
new RankContainer(19, "Platinum 1", "/rank/v1/19.svg"),
20 => new RankContainer(20, "Diamond", "/rank/v1/20.svg"),

new RankContainer(20, "Diamond", "/rank/v1/20.svg"),
_ => new RankContainer(0, "Unranked", "/rank/v1/0.svg")
};

#endregion
Expand Down

0 comments on commit 9403f2e

Please sign in to comment.