mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
terrainFilter now accommodates nationFilter for owner
This commit is contained in:
@ -535,9 +535,11 @@ open class Tile : IsPartOfGameInfoSerialization {
|
|||||||
"Natural Wonder" -> naturalWonder != null
|
"Natural Wonder" -> naturalWonder != null
|
||||||
"Featureless" -> terrainFeatures.isEmpty()
|
"Featureless" -> terrainFeatures.isEmpty()
|
||||||
Constants.freshWaterFilter -> isAdjacentTo(Constants.freshWater)
|
Constants.freshWaterFilter -> isAdjacentTo(Constants.freshWater)
|
||||||
|
|
||||||
|
in terrainFeatures -> true
|
||||||
else -> {
|
else -> {
|
||||||
if (terrainFeatures.contains(filter)) return true
|
|
||||||
if (terrainUniqueMap.getUniques(filter).any()) return true
|
if (terrainUniqueMap.getUniques(filter).any()) return true
|
||||||
|
if (getOwner()?.nation?.matchesFilter(filter) == true) return true
|
||||||
|
|
||||||
// Resource type check is last - cannot succeed if no resource here
|
// Resource type check is last - cannot succeed if no resource here
|
||||||
if (resource == null) return false
|
if (resource == null) return false
|
||||||
|
@ -61,7 +61,7 @@ Allows filtering for specific nations.
|
|||||||
- `City-states`
|
- `City-states`
|
||||||
- `Major`
|
- `Major`
|
||||||
- Nation name
|
- Nation name
|
||||||
- Nation unique
|
- A unique a Nation has (verbatim, no placeholders)
|
||||||
|
|
||||||
## cityFilter
|
## cityFilter
|
||||||
|
|
||||||
@ -96,15 +96,6 @@ Allowed values are:
|
|||||||
- `Great Improvements`, `Great`
|
- `Great Improvements`, `Great`
|
||||||
- `All Road` - for Roads & Railroads
|
- `All Road` - for Roads & Railroads
|
||||||
|
|
||||||
## nationFilter
|
|
||||||
|
|
||||||
Allowed values are:
|
|
||||||
|
|
||||||
- `All`
|
|
||||||
- `Major`
|
|
||||||
- `CityState`
|
|
||||||
- The name of a Nation
|
|
||||||
- A unique a Nation has (verbatim, no placeholders)
|
|
||||||
|
|
||||||
## mapUnitFilter
|
## mapUnitFilter
|
||||||
|
|
||||||
@ -176,6 +167,7 @@ This indicates the terrain on a single tile. The following values are allowed:
|
|||||||
- Terrain feature uniques
|
- Terrain feature uniques
|
||||||
- Resource
|
- Resource
|
||||||
- Natural wonder
|
- Natural wonder
|
||||||
|
- A [nationFilter](#nationfilter) matching the tile owner
|
||||||
- Or the filter is a constant string choosing a derived test:
|
- Or the filter is a constant string choosing a derived test:
|
||||||
- `All`
|
- `All`
|
||||||
- `Water`, `Land`
|
- `Water`, `Land`
|
||||||
|
Reference in New Issue
Block a user