mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Welp, turns out I forgot to apply conditionals
This commit is contained in:
parent
a56874282b
commit
dcb1be8e9b
@ -19,9 +19,11 @@ interface IHasUniques {
|
|||||||
* But making this a function is relevant for future "unify Unciv object" plans ;)
|
* But making this a function is relevant for future "unify Unciv object" plans ;)
|
||||||
* */
|
* */
|
||||||
fun getUniqueTarget(): UniqueTarget
|
fun getUniqueTarget(): UniqueTarget
|
||||||
|
|
||||||
fun getMatchingUniques(uniqueTemplate: String, stateForConditionals: StateForConditionals? = null) =
|
fun getMatchingUniques(uniqueTemplate: String, stateForConditionals: StateForConditionals? = null): Sequence<Unique> {
|
||||||
uniqueMap[uniqueTemplate]?.asSequence() ?: sequenceOf()
|
val matchingUniques = uniqueMap[uniqueTemplate] ?: return sequenceOf()
|
||||||
|
return matchingUniques.asSequence().filter { it.conditionalsApply(stateForConditionals) }
|
||||||
|
}
|
||||||
|
|
||||||
fun getMatchingUniques(uniqueType: UniqueType, stateForConditionals: StateForConditionals? = null) =
|
fun getMatchingUniques(uniqueType: UniqueType, stateForConditionals: StateForConditionals? = null) =
|
||||||
getMatchingUniques(uniqueType.placeholderText, stateForConditionals)
|
getMatchingUniques(uniqueType.placeholderText, stateForConditionals)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user