mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Working ordering for in game AND race finish screen.
List in RaceState holds a sorted list of yachts. A Listener is added to this list, listening for a permutation change, on perm change, sorts the list by comparitor of leg number of each yacht (stable sort)
This commit is contained in:
@@ -83,10 +83,11 @@ public class RaceState {
|
||||
}
|
||||
|
||||
public void sortPlayers() {
|
||||
playerPositions.sort(Comparator.comparingInt(ClientYacht::getLegNumber));
|
||||
playerPositions.sort((yacht1, yacht2) -> Integer.compare(yacht2.getLegNumber(),
|
||||
yacht1.getLegNumber()));
|
||||
}
|
||||
|
||||
public ObservableList<ClientYacht> getPlayerPositions() {
|
||||
return FXCollections.unmodifiableObservableList(playerPositions);
|
||||
return playerPositions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user