CityCombatant.matchesFilter contains multifilter and civ filter

This commit is contained in:
Yair Morgenstern 2024-01-25 00:12:40 +02:00
parent 414a11a2d6
commit 21581b43a0

View File

@ -1,5 +1,6 @@
package com.unciv.logic.battle
import com.unciv.logic.MultiFilter
import com.unciv.logic.city.City
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.map.tile.Tile
@ -23,7 +24,7 @@ class CityCombatant(val city: City) : ICombatant {
override fun isDefeated(): Boolean = city.health == 1
override fun isInvisible(to: Civilization): Boolean = false
override fun canAttack(): Boolean = city.canBombard()
override fun matchesFilter(filter: String) = filter == "City" || filter == "All"
override fun matchesFilter(filter: String) = MultiFilter.multiFilter(filter, {it == "City" || it == "All" || city.civ.matchesFilter(it)})
override fun getAttackSound() = UncivSound.Bombard
override fun takeDamage(damage: Int) {