SteamWar/FightSystem
Archiviert
13
1

Changed Fight Scoreboard to SWScoreboard #194

Manuell gemergt
Lixfel hat 7 Commits von scoreboard-reimplement nach master 2020-11-17 09:29:41 +01:00 zusammengeführt
Nur Änderungen aus Commit 26e71da87a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -24,6 +24,7 @@ import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.record.RecordSystem;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.winconditions.*; import de.steamwar.fightsystem.winconditions.*;
import de.steamwar.scoreboard.SWScoreboard; import de.steamwar.scoreboard.SWScoreboard;
@ -59,6 +60,8 @@ public class FightScoreboard implements Listener {
SWScoreboard.createScoreboard(event.getPlayer(), new ScoreboardCallback() { SWScoreboard.createScoreboard(event.getPlayer(), new ScoreboardCallback() {
@Override @Override
public HashMap<String, Integer> getData() { public HashMap<String, Integer> getData() {
return objective.getScores(); return objective.getScores();
} }
@ -85,6 +88,8 @@ public class FightScoreboard implements Listener {
private static ScoreBoardObjective generalScoreboard(){ private static ScoreBoardObjective generalScoreboard(){
final ScoreBoardObjective objective = new ScoreBoardObjective("§6Kampf"); final ScoreBoardObjective objective = new ScoreBoardObjective("§6Kampf");
if(Config.recording())
RecordSystem.scoreboardTitle(objective.getTitle());
if (Config.Timeout || Config.Points || Config.HeartRatioTimeout) { if (Config.Timeout || Config.Points || Config.HeartRatioTimeout) {
int fightTime = FightSystem.getFightTime(); int fightTime = FightSystem.getFightTime();
if (fightTime >= 60) if (fightTime >= 60)
@ -113,6 +118,8 @@ public class FightScoreboard implements Listener {
objective.addScore(Fight.getBlueTeam().getPrefix() + "Kanonen: " + WinconditionPumpkinTechKO.getTeamBluePumpkins(), 0); objective.addScore(Fight.getBlueTeam().getPrefix() + "Kanonen: " + WinconditionPumpkinTechKO.getTeamBluePumpkins(), 0);
} }
} }
if(Config.recording())
objective.scores.forEach(RecordSystem::scoreboardData);
Review

Du sendest jeden Score doppelt raus.

Du sendest jeden Score doppelt raus.
return objective; return objective;
} }
@ -141,6 +148,8 @@ public class FightScoreboard implements Listener {
private final HashMap<String, Integer> scores = new HashMap<>(); private final HashMap<String, Integer> scores = new HashMap<>();
public ScoreBoardObjective(String title) { public ScoreBoardObjective(String title) {
if(Config.recording())
RecordSystem.scoreboardTitle(title);
this.title = title; this.title = title;
} }
@ -149,6 +158,8 @@ public class FightScoreboard implements Listener {
} }
public void addScore(String string, int i) { public void addScore(String string, int i) {
if(Config.recording())
RecordSystem.scoreboardData(string, i);
Review

Hier zweite Scoresendung.

Hier zweite Scoresendung.
scores.put(string, i); scores.put(string, i);
} }