mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 23:44:24 +07:00
perf(memory): Reuse conditional states
This commit is contained in:
parent
6751739f39
commit
4edf8a7c9e
@ -186,9 +186,9 @@ class TileStatFunctions(val tile: Tile) {
|
||||
fun addStats(filter: String, stat: Stat, amount: Float) {
|
||||
if (tile.matchesFilter(filter, observingCiv, true))
|
||||
terrainStats.add(stat, amount)
|
||||
else if (improvement != null && improvement.matchesFilter(filter, StateForConditionals(city = city, tile = tile)))
|
||||
else if (improvement != null && improvement.matchesFilter(filter, stateForConditionals))
|
||||
improvementStats.add(stat, amount)
|
||||
else if (road != null && road.matchesFilter(filter, StateForConditionals(city = city, tile = tile)))
|
||||
else if (road != null && road.matchesFilter(filter, stateForConditionals))
|
||||
roadStats.add(stat, amount)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user