Cities provide resources that are in the city center

Cities founded on forest/jungle/marsh remove terrain feature
This commit is contained in:
Yair Morgenstern 2017-12-05 11:07:13 +02:00
parent 65bff07905
commit 060be89e55

View File

@ -59,24 +59,27 @@ public class CityInfo {
tileInfo.owner = civInfo.civName;
}
getTile().workingCity = this.name;
getTile().roadStatus = RoadStatus.Railroad;
TileInfo tile = getTile();
tile.workingCity = this.name;
tile.roadStatus = RoadStatus.Railroad;
if("Forest".equals(tile.terrainFeature) || "Jungle".equals(tile.terrainFeature) || "Marsh".equals(tile.terrainFeature))
tile.terrainFeature=null;
autoAssignWorker();
civInfo.cities.add(this);
}
ArrayList<String> getLuxuryResources() {
ArrayList<String> LuxuryResources = new ArrayList<String>();
LinqCollection<String> LuxuryResources = new LinqCollection<String>();
for (TileInfo tileInfo : getTilesInRange()) {
TileResource resource = tileInfo.getTileResource();
if (resource != null && resource.resourceType == ResourceType.Luxury && resource.improvement.equals(tileInfo.improvement))
if (resource != null && resource.resourceType == ResourceType.Luxury &&
(resource.improvement.equals(tileInfo.improvement) || tileInfo.isCityCenter()))
LuxuryResources.add(tileInfo.resource);
}
return LuxuryResources;
return LuxuryResources.unique();
}
private int getWorkingPopulation() {
return getTilesInRange().count(new Predicate<TileInfo>() {
@Override