mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 03:22:20 +07:00
Fixed "isWorked" not registering for tiles worked not by the owning city
This commit is contained in:
parent
6a7773730b
commit
b012fd0df8
@ -33,8 +33,8 @@ allprojects {
|
|||||||
version = '1.0.1'
|
version = '1.0.1'
|
||||||
ext {
|
ext {
|
||||||
appName = "Unciv"
|
appName = "Unciv"
|
||||||
appCodeNumber = 425
|
appCodeNumber = 426
|
||||||
appVersion = "3.8.7"
|
appVersion = "3.8.7-patch1"
|
||||||
|
|
||||||
gdxVersion = '1.9.10'
|
gdxVersion = '1.9.10'
|
||||||
roboVMVersion = '2.3.1'
|
roboVMVersion = '2.3.1'
|
||||||
|
@ -147,15 +147,19 @@ open class TileInfo {
|
|||||||
fun getTerrainFeature(): Terrain? =
|
fun getTerrainFeature(): Terrain? =
|
||||||
if (terrainFeature == null) null else ruleset.terrains[terrainFeature!!]
|
if (terrainFeature == null) null else ruleset.terrains[terrainFeature!!]
|
||||||
|
|
||||||
|
fun getWorkingCity():CityInfo? {
|
||||||
|
val civInfo = getOwner()
|
||||||
|
if (civInfo == null) return null
|
||||||
|
return civInfo.cities.firstOrNull { it.workedTiles.contains(position) }
|
||||||
|
}
|
||||||
|
|
||||||
fun isWorked(): Boolean {
|
fun isWorked(): Boolean {
|
||||||
val city = getCity()
|
return getWorkingCity() != null
|
||||||
return city!=null && city.workedTiles.contains(position)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isLocked(): Boolean{
|
fun isLocked(): Boolean{
|
||||||
val city = getCity()
|
val workingCity = getWorkingCity()
|
||||||
return city!=null && city.lockedTiles.contains(position)
|
return workingCity!=null && workingCity.lockedTiles.contains(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTileStats(observingCiv: CivilizationInfo): Stats = getTileStats(getCity(), observingCiv)
|
fun getTileStats(observingCiv: CivilizationInfo): Stats = getTileStats(getCity(), observingCiv)
|
||||||
|
Loading…
Reference in New Issue
Block a user