improvementFilter accepts uniques as well

This commit is contained in:
Yair Morgenstern 2022-04-20 09:37:00 +03:00
parent bd41630f84
commit c5c06a2456
2 changed files with 4 additions and 1 deletions

View File

@ -83,6 +83,7 @@ class TileImprovement : RulesetStatsObject() {
"All" -> true
"All Road" -> isRoad()
"Great Improvement", "Great" -> isGreatImprovement()
in uniques -> true
else -> false
}
}

View File

@ -341,7 +341,9 @@ enum class UniqueParameterType(
override fun getErrorSeverity(parameterText: String, ruleset: Ruleset):
UniqueType.UniqueComplianceErrorSeverity? {
if (parameterText in knownValues) return null
return ImprovementName.getErrorSeverity(parameterText, ruleset)
if (ImprovementName.getErrorSeverity(parameterText, ruleset) == null) return null
if (ruleset.tileImprovements.values.any { it.hasUnique(parameterText) }) return null
return UniqueType.UniqueComplianceErrorSeverity.RulesetSpecific
}
override fun isTranslationWriterGuess(parameterText: String, ruleset: Ruleset) =
parameterText != "All" && getErrorSeverity(parameterText, ruleset) == null