From aa6bd364def2bcd7b3956e617dcf16b46bd0fa65 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 19 Apr 2022 15:21:05 +0300 Subject: [PATCH] Unified unit type filters and removed unwanted ones --- .../ruleset/unique/UniqueParameterType.kt | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt index 65c1412e87..edafd84a7f 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt @@ -79,26 +79,13 @@ enum class UniqueParameterType( UnitTypeFilter("unitType", "Unit Type Filters") { // As you can see there is a difference between these and what's in unitTypeStrings (for translation) - // the goal is to unify, but for now this is the "real" list - private val knownValues = setOf("All", "Melee", "Ranged", "Civilian", "Military", "Land", "Water", "Air", - "non-air", "Nuclear Weapon", "Great Person", "Religious", "Barbarian") - // TODO make this obsolete - private val unitTypeStrings = setOf( - "Military", - "Civilian", - "non-air", - "relevant", - "Nuclear Weapon", - "City", - "Barbarian", - "Great Person", + // Note: this can't handle combinations of parameters (e.g. [{Military} {Water}]) + private val knownValues = setOf( + "All", "Melee", "Ranged", "Civilian", "Military", "Land", "Water", "Air", + "non-air", "Nuclear Weapon", "Great Person", "Religious", "Barbarian", + "relevant", "City", // These are up for debate - "Air", - "land units", - "water units", - "air units", - "military units", - "submarine units", - // Note: this can't handle combinations of parameters (e.g. [{Military} {Water}]) +// "land units", "water units", "air units", "military units", "submarine units", ) override fun getErrorSeverity(parameterText: String, ruleset: Ruleset): @@ -110,8 +97,9 @@ enum class UniqueParameterType( } override fun isTranslationWriterGuess(parameterText: String, ruleset: Ruleset) = - parameterText in ruleset.unitTypes.keys || parameterText in unitTypeStrings - override fun getTranslationWriterStringsForOutput() = unitTypeStrings + parameterText in ruleset.unitTypes.keys || parameterText in getTranslationWriterStringsForOutput() + + override fun getTranslationWriterStringsForOutput() = knownValues }, UnitName("unit") {