This commit is contained in:
Yair Morgenstern
2022-02-28 22:49:11 +02:00
parent c9dfd4062d
commit 00c5ecb6a6
11 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import com.unciv.models.stats.Stat
// parameterName values should be compliant with autogenerated values in TranslationFileWriter.generateStringsFromJSONs
// Eventually we'll merge the translation generation to take this as the source of that
@Suppress("unused") // Some are used only via enumerating the enum matching on parameterName
enum class UniqueParameterType(val parameterName:String) {
enum class UniqueParameterType(var parameterName:String) {
Number("amount") {
override fun getErrorSeverity(parameterText: String, ruleset: Ruleset):
UniqueType.UniqueComplianceErrorSeverity? {
@ -369,7 +369,7 @@ enum class UniqueParameterType(val parameterName:String) {
"in cities following this religion",
)
fun safeValueOf(param: String) = values().firstOrNull { it.parameterName == param } ?: Unknown
fun safeValueOf(param: String) = values().firstOrNull { it.parameterName == param } ?: Unknown.apply { this.parameterName = param }
}
}