Search in sources :

Example 36 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine in project Hyperium by HyperiumClient.

the class SpeedUHCStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder speedUhc = player.getStats(GameType.SPEED_UHC);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(speedUhc.optInt("kills"), speedUhc.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(speedUhc.optInt("wins"), speedUhc.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Salt: ", speedUhc.optInt("salt"))));
    final String[] SpeedUHC_modes = { "Solo Normal", "Solo Insane", "Team Normal", "Team Insane" };
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "K/D", "W/L" });
    for (String name : SpeedUHC_modes) {
        String api = name.toLowerCase().replace(" ", "_");
        lines.add(new String[] { name, String.valueOf(speedUhc.optInt("kills_" + api)), String.valueOf(speedUhc.optInt("deaths_" + api)), String.valueOf(speedUhc.optInt("wins_" + api)), String.valueOf(speedUhc.optInt("losses_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("kills_" + api), speedUhc.optInt("deaths_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("wins_" + api), speedUhc.optInt("losses_" + api)) });
    }
    stats.add(new DisplayTable(lines));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 37 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine in project Hyperium by HyperiumClient.

the class TNTGamesStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder tntGames = player.getStats(GameType.TNTGAMES);
    stats.add(new DisplayLine(bold("Coins: ", tntGames.optInt("coins"))));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 38 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine in project Hyperium by HyperiumClient.

the class BuildBattleStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder arcade = player.getStats(GameType.ARCADE);
    stats.add(new DisplayLine(bold("Build Battle wins: ", arcade.optInt("wins_buildbattle"))));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 39 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine in project Hyperium by HyperiumClient.

the class SmashHeroesStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder smashHeroes = player.getStats(GameType.SUPER_SMASH);
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(smashHeroes.optInt("kills"), smashHeroes.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(smashHeroes.optInt("wins"), smashHeroes.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Smash Level: ", smashHeroes.optInt("smashLevel"))));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)

Example 40 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine in project Hyperium by HyperiumClient.

the class SmashHeroesStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder smashHeroes = player.getStats(GameType.SUPER_SMASH);
    stats.add(new DisplayLine(bold("Coins: ", smashHeroes.optInt("coins"))));
    stats.add(new DisplayLine(bold("Kills: ", smashHeroes.optInt("kills"))));
    stats.add(new DisplayLine(bold("Deaths: ", smashHeroes.optInt("deaths"))));
    stats.add(new DisplayLine(bold("Wins: ", smashHeroes.optInt("wins"))));
    stats.add(new DisplayLine(bold("Losses: ", smashHeroes.optInt("losses"))));
    return stats;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Aggregations

DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)44 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)43 JsonHolder (cc.hyperium.utils.JsonHolder)42 ArrayList (java.util.ArrayList)32 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Pet (club.sk1er.website.Pet)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 GameType (net.hypixel.api.GameType)1