mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 12:07:35 +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 ActivityPart activityPart;
|
||||||
private final CommandUsagePart commandUsagePart;
|
private final CommandUsagePart commandUsagePart;
|
||||||
private final GamemodePart gamemodePart;
|
|
||||||
private final GeolocationPart geolocationPart;
|
private final GeolocationPart geolocationPart;
|
||||||
private final JoinInfoPart joinInfoPart;
|
private final JoinInfoPart joinInfoPart;
|
||||||
private final KillPart killPart;
|
private final KillPart killPart;
|
||||||
@ -51,7 +50,6 @@ public class AnalysisData extends RawData {
|
|||||||
playerCountPart = new PlayerCountPart();
|
playerCountPart = new PlayerCountPart();
|
||||||
playtimePart = new PlaytimePart();
|
playtimePart = new PlaytimePart();
|
||||||
killPart = new KillPart();
|
killPart = new KillPart();
|
||||||
gamemodePart = new GamemodePart();
|
|
||||||
tpsPart = new TPSPart(tpsData);
|
tpsPart = new TPSPart(tpsData);
|
||||||
activityPart = new ActivityPart(joinInfoPart, tpsPart);
|
activityPart = new ActivityPart(joinInfoPart, tpsPart);
|
||||||
worldPart = new WorldPart();
|
worldPart = new WorldPart();
|
||||||
@ -65,10 +63,6 @@ public class AnalysisData extends RawData {
|
|||||||
return commandUsagePart;
|
return commandUsagePart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GamemodePart getGamemodePart() {
|
|
||||||
return gamemodePart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GeolocationPart getGeolocationPart() {
|
public GeolocationPart getGeolocationPart() {
|
||||||
return geolocationPart;
|
return geolocationPart;
|
||||||
}
|
}
|
||||||
@ -98,9 +92,9 @@ public class AnalysisData extends RawData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<RawData> getAllParts() {
|
public List<RawData> getAllParts() {
|
||||||
return Arrays.asList(activityPart, commandUsagePart, gamemodePart,
|
return Arrays.asList(activityPart, commandUsagePart, geolocationPart,
|
||||||
geolocationPart, joinInfoPart, killPart,
|
joinInfoPart, killPart, playerCountPart, playtimePart, tpsPart,
|
||||||
playerCountPart, playtimePart, tpsPart, worldPart);
|
worldPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPlanVersion() {
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -237,7 +237,6 @@ public class Analysis {
|
|||||||
|
|
||||||
private void fillDataset(AnalysisData analysisData) {
|
private void fillDataset(AnalysisData analysisData) {
|
||||||
ActivityPart activity = analysisData.getActivityPart();
|
ActivityPart activity = analysisData.getActivityPart();
|
||||||
GamemodePart gmPart = analysisData.getGamemodePart();
|
|
||||||
GeolocationPart geolocPart = analysisData.getGeolocationPart();
|
GeolocationPart geolocPart = analysisData.getGeolocationPart();
|
||||||
JoinInfoPart joinInfo = analysisData.getJoinInfoPart();
|
JoinInfoPart joinInfo = analysisData.getJoinInfoPart();
|
||||||
KillPart killPart = analysisData.getKillPart();
|
KillPart killPart = analysisData.getKillPart();
|
||||||
|
Loading…
Reference in New Issue
Block a user