mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-07-31 09:27:42 +02:00
Modelle Fixes
This commit is contained in:
@@ -3,7 +3,6 @@ package pp.monopoly.model.fields;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.jme3.network.serializing.Serializable;
|
||||
@@ -180,5 +179,17 @@ public class BoardManager {
|
||||
return groupProperties.stream()
|
||||
.allMatch(bp -> bp.getHouses() <= currentHouses);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt eine Liste von BuildingProperty-Feldern zurück, auf denen Häuser oder Hotels stehen.
|
||||
* @return Liste von BuildingProperty-Feldern mit Gebäuden
|
||||
*/
|
||||
public List<BuildingProperty> getPropertiesWithBuildings() {
|
||||
return board.stream()
|
||||
.filter(f -> f instanceof BuildingProperty)
|
||||
.map(f -> (BuildingProperty) f)
|
||||
.filter(bp -> bp.getHouses() > 0 || bp.getHotel() > 0)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user