|
@ -63,19 +63,19 @@ public class PlayerService extends CrudService<Player, Integer> { |
|
|
PlayerForTable currentPlayer; |
|
|
PlayerForTable currentPlayer; |
|
|
for (int i = 0; i < playerForTableList.size(); i++) { |
|
|
for (int i = 0; i < playerForTableList.size(); i++) { |
|
|
currentPlayer = playerForTableList.get(i); |
|
|
currentPlayer = playerForTableList.get(i); |
|
|
if (i>0) { |
|
|
|
|
|
lastPlayer = playerForTableList.get(i-1); |
|
|
|
|
|
|
|
|
if (i > 0) { |
|
|
|
|
|
lastPlayer = playerForTableList.get(i - 1); |
|
|
// TODO: add direct comparison below |
|
|
// TODO: add direct comparison below |
|
|
if (Objects.equals(currentPlayer.getMatchPoints(), lastPlayer.getMatchPoints()) |
|
|
if (Objects.equals(currentPlayer.getMatchPoints(), lastPlayer.getMatchPoints()) |
|
|
&& Objects.equals(currentPlayer.getGamePointsForSelf(), lastPlayer.getGamePointsForSelf()) |
|
|
&& Objects.equals(currentPlayer.getGamePointsForSelf(), lastPlayer.getGamePointsForSelf()) |
|
|
&& Objects.equals(currentPlayer.getGamePointsForOpponents(), lastPlayer.getGamePointsForOpponents())) { |
|
|
&& Objects.equals(currentPlayer.getGamePointsForOpponents(), lastPlayer.getGamePointsForOpponents())) { |
|
|
offset +=1; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
|
|
|
offset += 1; |
|
|
|
|
|
} else { |
|
|
offset = 0; |
|
|
offset = 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
currentPlayer.setPlace(i + 1 - offset); |
|
|
currentPlayer.setPlace(i + 1 - offset); |
|
|
|
|
|
currentPlayer.setPlaceString(offset == 0 ? String.valueOf(i + 1) : ""); |
|
|
} |
|
|
} |
|
|
// TODO: add diff to last matchday |
|
|
// TODO: add diff to last matchday |
|
|
return playerForTableList; |
|
|
return playerForTableList; |
|
|