mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-10-31 18:59:03 +01:00 
			
		
		
		
	sort according to id
This commit is contained in:
		| @@ -18,8 +18,11 @@ import pp.monopoly.model.fields.FoodField; | |||||||
| import pp.monopoly.model.fields.GateField; | import pp.monopoly.model.fields.GateField; | ||||||
| import pp.monopoly.model.fields.PropertyField; | import pp.monopoly.model.fields.PropertyField; | ||||||
|  |  | ||||||
|  | import java.text.Collator; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
|  | import java.util.Comparator; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * PropertyOverviewMenu is a dialog for displaying the player's properties in the game. |  * 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 |         // 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) { |             if (property instanceof BuildingProperty) { | ||||||
|                 BuildingProperty building = (BuildingProperty) property; |                 BuildingProperty building = (BuildingProperty) property; | ||||||
|                 cards.add(createBuildingCard(building)); |                 cards.add(createBuildingCard(building)); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user