fix: score display
All checks were successful
Linux arm64 / Build (push) Successful in 28s

This commit is contained in:
2025-02-01 12:54:11 +01:00
parent 02089c649b
commit f22debdf5f
6 changed files with 20 additions and 17 deletions

View File

@@ -37,10 +37,10 @@ public class Game {
leaderboard.add(player);
}
public void setPlayerScore(Player player, int newScore) {
player.setScore(newScore);
public void setPlayerRemainingCells(Player player, int newScore) {
player.setRemainingCells(newScore);
Collections.sort(this.leaderboard,
(player1, player2) -> Integer.compare(player1.getScore(), player2.getScore()));
(player1, player2) -> Integer.compare(player1.getRemainingCells(), player2.getRemainingCells()));
}
public void removePlayer(int id) {

View File

@@ -16,11 +16,11 @@ public class Player implements Serializable {
this.score = 0;
}
public int getScore() {
public int getRemainingCells() {
return score;
}
void setScore(int score) {
void setRemainingCells(int score) {
this.score = score;
}