|
7 | 7 |
|
8 | 8 | var ( |
9 | 9 | // validHighscoreCatregories stores all valid highscore categories |
10 | | - validHighscoreCategories = []string{"achievements", "achievement", "axe", "axefighting", "charm", "charms", "charmpoints", "charmspoints", "club", "clubfighting", "distance", "distancefighting", "fishing", "fist", "fistfighting", "goshnar", "goshnars", "goshnarstaint", "loyalty", "loyaltypoints", "magic", "mlvl", "magiclevel", "shielding", "shield", "sword", "swordfighting", "drome", "dromescore", "experience", "boss", "bosses", "bosspoints"} |
| 10 | + validHighscoreCategories = []string{"achievements", "achievement", "axe", "axefighting", "charm", "charms", "charmpoints", "charmspoints", "club", "clubfighting", "distance", "distancefighting", "fishing", "fist", "fistfighting", "goshnar", "goshnars", "goshnarstaint", "loyalty", "loyaltypoints", "magic", "mlvl", "magiclevel", "shielding", "shield", "sword", "swordfighting", "drome", "dromescore", "experience", "boss", "bosses", "bosspoints", "bountypoints", "bountypoint", "bountypointsearned", "weeklytasks", "weeklytask", "weeklytaskscompleted"} |
11 | 11 | ) |
12 | 12 |
|
13 | 13 | // IsHighscoreCategoryValid reports wheter the provided string represents a valid highscore category |
@@ -40,11 +40,13 @@ const ( |
40 | 40 | HighScoreSwordfighting |
41 | 41 | HighScoreDromescore |
42 | 42 | HighScoreBosspoints |
| 43 | + HighScoreBountypoints |
| 44 | + HighScoreWeeklytasks |
43 | 45 | ) |
44 | 46 |
|
45 | 47 | func (hc HighscoreCategory) String() (string, error) { |
46 | | - seasons := [...]string{"achievements", "axefighting", "charmpoints", "clubfighting", "distancefighting", "experience", "fishing", "fistfighting", "goshnarstaint", "loyaltypoints", "magiclevel", "shielding", "swordfighting", "dromescore", "bosspoints"} |
47 | | - if hc < HighScoreAchievements || hc > HighScoreBosspoints { |
| 48 | + seasons := [...]string{"achievements", "axefighting", "charmpoints", "clubfighting", "distancefighting", "experience", "fishing", "fistfighting", "goshnarstaint", "loyaltypoints", "magiclevel", "shielding", "swordfighting", "dromescore", "bosspoints", "bountypoints", "weeklytasks"} |
| 49 | + if hc < HighScoreAchievements || hc > HighScoreWeeklytasks { |
48 | 50 | return "", errors.New("invalid HighscoreCategory value") |
49 | 51 | } |
50 | 52 | return seasons[hc-1], nil |
@@ -82,6 +84,10 @@ func HighscoreCategoryFromString(input string) HighscoreCategory { |
82 | 84 | return HighScoreDromescore |
83 | 85 | case "boss", "bosses", "bosspoints": |
84 | 86 | return HighScoreBosspoints |
| 87 | + case "bountypoints", "bountypoint", "bountypointsearned": |
| 88 | + return HighScoreBountypoints |
| 89 | + case "weeklytasks", "weeklytask", "weeklytaskscompleted": |
| 90 | + return HighScoreWeeklytasks |
85 | 91 | default: |
86 | 92 | return HighScoreExperience |
87 | 93 | } |
|
0 commit comments