mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +01:00
Deleted GameModePart
This commit is contained in:
parent
159c0f1a4a
commit
4f8581bb0c
@ -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<RawData> 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() {
|
||||
|
@ -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.
|
||||
* <p>
|
||||
* Gamemode Piechart, Percentages and Totals.
|
||||
* <p>
|
||||
* Placeholder values can be retrieved using the get method.
|
||||
* <p>
|
||||
* 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;
|
||||
}
|
||||
}
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user