Polished and finalized spleef gamemode
This commit is contained in:
@@ -17,15 +17,17 @@ public class LastWinsScore extends Score {
|
||||
this.ignoreLastPlayers = ignoreLastPlayers;
|
||||
}
|
||||
|
||||
public void setIgnoreLastPlayers(int ignoreLastPlayers) {
|
||||
this.ignoreLastPlayers = ignoreLastPlayers;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkGameEnd() {
|
||||
if(this.isDone()) return;
|
||||
if(!instance.isRunning()) return;
|
||||
if(instance.getPlayers().isEmpty()) return;
|
||||
if(scores.size() >= instance.getPlayers().size() - ignoreLastPlayers) setDone();
|
||||
if(scores.size() >= instance.getPlayers().size() - ignoreLastPlayers) {
|
||||
if(ignoreLastPlayers > 0) {
|
||||
instance.getPlayers().stream().filter(player -> !scores.contains(player)).forEach(this::addResult);
|
||||
}
|
||||
setDone();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user