mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
sort according to id
This commit is contained in:
parent
9bf9e8406b
commit
2f025e2e1a
@ -18,8 +18,11 @@ import pp.monopoly.model.fields.FoodField;
|
||||
import pp.monopoly.model.fields.GateField;
|
||||
import pp.monopoly.model.fields.PropertyField;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* PropertyOverviewMenu is a dialog for displaying the player's properties in the game.
|
||||
@ -102,7 +105,7 @@ public class PropertyOverviewMenu extends Dialog {
|
||||
}
|
||||
|
||||
// Iterate through the fetched properties
|
||||
for (PropertyField property : fields) {
|
||||
for (PropertyField property : fields.stream().sorted(Comparator.comparingInt(PropertyField::getId)).collect(Collectors.toList())) {
|
||||
if (property instanceof BuildingProperty) {
|
||||
BuildingProperty building = (BuildingProperty) property;
|
||||
cards.add(createBuildingCard(building));
|
||||
|
Loading…
Reference in New Issue
Block a user