diff options
author | Cow <cow@volloeko.de> | 2020-07-26 23:41:58 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2020-07-26 23:41:58 +0200 |
commit | 0027466a564a9a6bebbdeed05192a616175ea6f3 (patch) | |
tree | c6d8b5f61992bd1e418d83b1301cc087f673a2e1 /src/main/java/eu/olli/cowlection/data/DataHelper.java | |
parent | b9c5f23a671c50422303bf50e315d364b1354acf (diff) | |
download | Cowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.tar.gz Cowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.tar.bz2 Cowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.zip |
Replaced 3rd party with official API
Diffstat (limited to 'src/main/java/eu/olli/cowlection/data/DataHelper.java')
-rw-r--r-- | src/main/java/eu/olli/cowlection/data/DataHelper.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/eu/olli/cowlection/data/DataHelper.java b/src/main/java/eu/olli/cowlection/data/DataHelper.java index 4fa2f35..d6167b0 100644 --- a/src/main/java/eu/olli/cowlection/data/DataHelper.java +++ b/src/main/java/eu/olli/cowlection/data/DataHelper.java @@ -1,5 +1,7 @@ package eu.olli.cowlection.data; +import eu.olli.cowlection.util.Utils; + import java.util.HashMap; import java.util.Map; @@ -7,6 +9,61 @@ public final class DataHelper { private DataHelper() { } + // TODO replace with api request: https://github.com/HypixelDev/PublicAPI/blob/master/Documentation/misc/GameType.md + public enum GameType { + QUAKECRAFT("Quakecraft"), + WALLS("Walls"), + PAINTBALL("Paintball"), + SURVIVAL_GAMES("Blitz Survival Games"), + TNTGAMES("The TNT Games"), + VAMPIREZ("VampireZ"), + WALLS3("Mega Walls"), + ARCADE("Arcade"), + ARENA("Arena Brawl"), + UHC("UHC Champions"), + MCGO("Cops and Crims"), + BATTLEGROUND("Warlords"), + SUPER_SMASH("Smash Heroes"), + GINGERBREAD("Turbo Kart Racers"), + HOUSING("Housing"), + SKYWARS("SkyWars"), + TRUE_COMBAT("Crazy Walls"), + SPEED_UHC("Speed UHC"), + SKYCLASH("SkyClash"), + LEGACY("Classic Games"), + PROTOTYPE("Prototype"), + BEDWARS("Bed Wars"), + MURDER_MYSTERY("Murder Mystery"), + BUILD_BATTLE("Build Battle"), + DUELS("Duels"), + SKYBLOCK("SkyBlock"), + PIT("Pit"); + + private final String cleanName; + + GameType(String cleanName) { + this.cleanName = cleanName; + } + + public static String getFancyName(String gameName) { + if (gameName == null) { + return null; + } + String cleanGameType; + try { + cleanGameType = valueOf(gameName).getCleanName(); + } catch (IllegalArgumentException e) { + // no matching game type found + cleanGameType = Utils.fancyCase(gameName); + } + return cleanGameType; + } + + public String getCleanName() { + return cleanName; + } + } + public static Map<String, String> getMinions() { // key = skin id, value = minion type and tier Map<String, String> minions = new HashMap<>(); |