From 4f8581bb0cf20be749543434200b22b6c124df96 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Fri, 25 Aug 2017 09:48:32 +0300 Subject: [PATCH] Deleted GameModePart --- .../djrapitops/plan/data/AnalysisData.java | 12 +- .../plan/data/analysis/GamemodePart.java | 113 ------------------ .../plan/utilities/analysis/Analysis.java | 5 +- 3 files changed, 5 insertions(+), 125 deletions(-) delete mode 100644 Plan/src/main/java/com/djrapitops/plan/data/analysis/GamemodePart.java diff --git a/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java b/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java index e1d50e47f..eb6be8edd 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/AnalysisData.java @@ -30,7 +30,6 @@ public class AnalysisData extends RawData { private final ActivityPart activityPart; private final CommandUsagePart commandUsagePart; - private final GamemodePart gamemodePart; private final GeolocationPart geolocationPart; private final JoinInfoPart joinInfoPart; private final KillPart killPart; @@ -51,7 +50,6 @@ public class AnalysisData extends RawData { playerCountPart = new PlayerCountPart(); playtimePart = new PlaytimePart(); killPart = new KillPart(); - gamemodePart = new GamemodePart(); tpsPart = new TPSPart(tpsData); activityPart = new ActivityPart(joinInfoPart, tpsPart); worldPart = new WorldPart(); @@ -65,10 +63,6 @@ public class AnalysisData extends RawData { return commandUsagePart; } - public GamemodePart getGamemodePart() { - return gamemodePart; - } - public GeolocationPart getGeolocationPart() { return geolocationPart; } @@ -98,9 +92,9 @@ public class AnalysisData extends RawData { } public List getAllParts() { - return Arrays.asList(activityPart, commandUsagePart, gamemodePart, - geolocationPart, joinInfoPart, killPart, - playerCountPart, playtimePart, tpsPart, worldPart); + return Arrays.asList(activityPart, commandUsagePart, geolocationPart, + joinInfoPart, killPart, playerCountPart, playtimePart, tpsPart, + worldPart); } public String getPlanVersion() { diff --git a/Plan/src/main/java/com/djrapitops/plan/data/analysis/GamemodePart.java b/Plan/src/main/java/com/djrapitops/plan/data/analysis/GamemodePart.java deleted file mode 100644 index a578ba2bb..000000000 --- a/Plan/src/main/java/com/djrapitops/plan/data/analysis/GamemodePart.java +++ /dev/null @@ -1,113 +0,0 @@ -package main.java.com.djrapitops.plan.data.analysis; - -import com.djrapitops.plugin.utilities.Verify; -import main.java.com.djrapitops.plan.utilities.html.HtmlUtils; - -/** - * Part responsible for all Gamemode usage related analysis. - *

- * Gamemode Piechart, Percentages and Totals. - *

- * Placeholder values can be retrieved using the get method. - *

- * Contains following place-holders: gmtotal, gm0col-gm3col, gmcolors, gmlabels, - * gm0-gm3, gmdata, gm0total-gm3total - * - * @author Rsl1122 - * @since 3.5.2 - */ -@Deprecated -public class GamemodePart extends RawData { - - private long survivalTime; - private long creativeTime; - private long adventureTime; - private long spectatorTime; - - public GamemodePart() { - survivalTime = 0; - creativeTime = 0; - adventureTime = 0; - spectatorTime = 0; - } - - @Override - public void analyse() { - gamemodePiechart(); - } - - private void gamemodePiechart() { - long totalTime = survivalTime + creativeTime + adventureTime + spectatorTime; - String gmColors = HtmlUtils.separateWithQuotes( - "#555", "#555", "#555", "#555" // TODO Write Colors (enum) variables for GameMode colors. - ); - addValue("gmColors", gmColors); - } - - /** - * Adds time to a gamemode. - * - * @param gm Name of Gamemode - * @param amount milliseconds to add - * @throws IllegalArgumentException if gm is null - */ - public void addTo(String gm, long amount) { - Verify.nullCheck(gm); - switch (gm) { - case "SURVIVAL": - addToSurvival(amount); - break; - case "CREATIVE": - addToCreative(amount); - break; - case "ADVENTURE": - addToAdventure(amount); - break; - case "SPECTATOR": - addToSpectator(amount); - break; - default: - break; - } - } - - public void addToSurvival(long amount) { - if (amount > 0) { - survivalTime += amount; - } - } - - public void addToCreative(long amount) { - if (amount > 0) { - creativeTime += amount; - } - } - - public void addToAdventure(long amount) { - if (amount > 0) { - adventureTime += amount; - } - } - - public void addToSpectator(long amount) { - if (amount > 0) { - spectatorTime += amount; - } - } - - public long getSurvivalTime() { - return survivalTime; - } - - public long getCreativeTime() { - return creativeTime; - } - - public long getAdventureTime() { - return adventureTime; - } - - public long getSpectatorTime() { - return spectatorTime; - } -} diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java index 5203ce34c..cffdad65d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/Analysis.java @@ -72,8 +72,8 @@ public class Analysis { * Caches analyzed data of db to the provided cache analysisCache. * * @param infoManager InformationManager of the plugin. - * method. - * @param db Database which data will be analyzed. + * method. + * @param db Database which data will be analyzed. * @return Whether or not analysis was successful. */ public boolean analyze(InformationManager infoManager, Database db) { @@ -237,7 +237,6 @@ public class Analysis { private void fillDataset(AnalysisData analysisData) { ActivityPart activity = analysisData.getActivityPart(); - GamemodePart gmPart = analysisData.getGamemodePart(); GeolocationPart geolocPart = analysisData.getGeolocationPart(); JoinInfoPart joinInfo = analysisData.getJoinInfoPart(); KillPart killPart = analysisData.getKillPart();