From 8bd8ed683f26d1f8e51fd0499a1ed8dd68220c46 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sun, 7 Apr 2024 12:43:38 +0300 Subject: [PATCH] Fix deprecated conditionals, caught by new mod checker --- .../jsons/Civ V - Gods & Kings/Nations.json | 6 +- .../Civ V - Gods & Kings/TileResources.json | 116 +++++++++--------- .../assets/jsons/Civ V - Vanilla/Nations.json | 2 +- .../jsons/Civ V - Vanilla/TileResources.json | 108 ++++++++-------- .../ruleset/validation/UniqueValidator.kt | 2 +- 5 files changed, 117 insertions(+), 117 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Nations.json b/android/assets/jsons/Civ V - Gods & Kings/Nations.json index 113aa33d0f..4bd5b3f60d 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Nations.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Nations.json @@ -32,7 +32,7 @@ "innerColor": [213,249,255], "favoredReligion": "Islam", "uniqueName": "Ingenuity", - "uniques": ["Free [Great Scientist] appears ", "[Great Scientist] is earned [50]% faster"], + "uniques": ["Free [Great Scientist] appears ", "[Great Scientist] is earned [50]% faster"], "cities": ["Babylon","Akkad","Dur-Kurigalzu","Nippur","Borsippa","Sippar","Opis","Mari","Shushan","Eshnunna", "Ellasar","Erech","Kutha","Sirpurla","Neribtum","Ashur","Ninveh","Nimrud","Arbela","Nuzi", "Arrapkha","Tutub","Shaduppum","Rapiqum","Mashkan Shapir","Tuttul","Ramad","Ana","Haradum","Agrab", @@ -954,8 +954,8 @@ "favoredReligion": "Christianity", "uniqueName": "Druidic Lore", - "uniques": ["[+1 Faith] [in all cities] ", - "[+2 Faith] [in all cities] "], + "uniques": ["[+1 Faith] [in all cities] ", + "[+2 Faith] [in all cities] "], "cities": ["Edinburgh","Dublin","Cardiff","Truro","Nantes","Douglas","Glasgow","Cork","Aberystwyth", "Penzance","Rennes","Ramsey","Inverness","Limerick","Swansea","St. Ives","Brest","Peel","Aberdeen", "Belfast","Caernarfon","Newquay","Saint-Nazaire","Castletown","Stirling","Galway","Conwy", diff --git a/android/assets/jsons/Civ V - Gods & Kings/TileResources.json b/android/assets/jsons/Civ V - Gods & Kings/TileResources.json index 02f657b110..48d77ed3f6 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/TileResources.json +++ b/android/assets/jsons/Civ V - Gods & Kings/TileResources.json @@ -7,8 +7,8 @@ "food": 1, "improvement": "Pasture", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [18] tiles ", - "Generated on every [22] tiles "] + "uniques": ["Generated on every [18] tiles ", + "Generated on every [22] tiles "] }, { "name": "Sheep", @@ -27,11 +27,11 @@ "food": 1, "improvement": "Camp", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [8] tiles ", - "Generated on every [12] tiles ", - "Generated on every [25] tiles ", - "Generated on every [25] tiles ", - "Generated on every [16] tiles ", + "uniques": ["Generated on every [8] tiles ", + "Generated on every [12] tiles ", + "Generated on every [25] tiles ", + "Generated on every [25] tiles ", + "Generated on every [16] tiles ", "Generated on every [28] tiles "] }, { @@ -50,10 +50,10 @@ "terrainsCanBeFoundOn": ["Plains","Flood plains","Desert"], // Desert only if fresh water "food": 1, "improvement": "Farm", - "uniques": ["Generated on every [27] tiles ", - "Generated on every [10] tiles ", - "Generated on every [20] tiles ", - "Generated on every [20] tiles "] + "uniques": ["Generated on every [27] tiles ", + "Generated on every [10] tiles ", + "Generated on every [20] tiles ", + "Generated on every [20] tiles "] }, { "name": "Stone", @@ -62,9 +62,9 @@ "production": 1, "improvement": "Quarry", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [20] tiles ", - "Generated on every [15] tiles ", - "Generated on every [19] tiles "] + "uniques": ["Generated on every [20] tiles ", + "Generated on every [15] tiles ", + "Generated on every [19] tiles "] }, { "name": "Fish", @@ -72,7 +72,7 @@ "terrainsCanBeFoundOn": ["Coast"], "food": 1, "improvement": "Fishing Boats", - "uniques": ["Generated on every [10] tiles "] + "uniques": ["Generated on every [10] tiles "] }, /* { @@ -95,13 +95,13 @@ "improvement": "Pasture", "improvementStats": {"production": 1}, "uniques": ["Guaranteed with Strategic Balance resource option", - "Generated with weight [100] ", - "Generated with weight [100] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [100] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] "], + "Generated with weight [100] ", + "Generated with weight [100] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [100] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [30] "], "majorDepositAmount": {"sparse": 4, "default": 4, "abundant": 6}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -113,19 +113,19 @@ "production": 1, "improvement": "Mine", "uniques": ["Guaranteed with Strategic Balance resource option", - "Generated with weight [45] ", - "Generated with weight [25] ", - "Generated with weight [35] ", + "Generated with weight [45] ", + "Generated with weight [25] ", + "Generated with weight [35] ", "Generated with weight [26] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [20] ", "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 4, "default": 6, "abundant": 9}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -143,11 +143,11 @@ "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [30] "], + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [30] "], "majorDepositAmount": {"sparse": 5, "default": 7, "abundant": 10}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -162,15 +162,15 @@ "uniques": ["Deposits in [Coast] tiles always provide [4] resources", "Guaranteed with Strategic Balance resource option", "Generated with weight [65] ", - "Generated with weight [40] ", - "Generated with weight [60] ", - "Generated with weight [65] ", - "Generated with weight [100] ", + "Generated with weight [40] ", + "Generated with weight [60] ", + "Generated with weight [65] ", + "Generated with weight [100] ", "Minor deposits generated with weight [20] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [20] "], + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [20] "], "majorDepositAmount": {"sparse": 5, "default": 7, "abundant": 9}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -182,11 +182,11 @@ "production": 1, "improvement": "Mine", "improvementStats": {"production": 1}, - "uniques": ["Generated with weight [15] ", - "Generated with weight [15] ", + "uniques": ["Generated with weight [15] ", + "Generated with weight [15] ", "Generated with weight [39] ", "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 5, "default": 8, "abundant": 10}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -202,8 +202,8 @@ "Generated with weight [70] ", "Generated with weight [70] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 2, "default": 4, "abundant": 4}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -285,9 +285,9 @@ "Generated near City States with weight [10]", "Doesn't generate naturally ", "Doesn't generate naturally ", - "Doesn't generate naturally ", - "Doesn't generate naturally ", - "Doesn't generate naturally " + "Doesn't generate naturally ", + "Doesn't generate naturally ", + "Doesn't generate naturally " ] }, { @@ -311,7 +311,7 @@ "uniques": ["Generated with weight [35] ", "Generated with weight [15] ", "Generated near City States with weight [10]", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Silk", @@ -338,7 +338,7 @@ "Generated with weight [5] ", "Generated near City States with weight [15]", "Doesn't generate naturally ", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Wine", @@ -373,7 +373,7 @@ "improvementStats": {"production": 1}, "uniques": ["[+15]% Production when constructing [All] wonders [in this city]", "Special placement during map generation", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Whales", @@ -445,7 +445,7 @@ "Generated with weight [20] ", "Generated with weight [20] ", "Generated near City States with weight [10]", - "Doesn't generate naturally ", + "Doesn't generate naturally ", "Doesn't generate naturally ", "Doesn't generate naturally "] }, @@ -490,7 +490,7 @@ "Generated with weight [25] ", "Generated with weight [15] ", "Generated near City States with weight [10]", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Truffles", @@ -505,7 +505,7 @@ "Generated with weight [5] ", "Generated with weight [10] ", "Generated near City States with weight [15]", - "Doesn't generate naturally ", - "Doesn't generate naturally "] + "Doesn't generate naturally ", + "Doesn't generate naturally "] } ] diff --git a/android/assets/jsons/Civ V - Vanilla/Nations.json b/android/assets/jsons/Civ V - Vanilla/Nations.json index 3e3ef9d072..8d0835db4a 100644 --- a/android/assets/jsons/Civ V - Vanilla/Nations.json +++ b/android/assets/jsons/Civ V - Vanilla/Nations.json @@ -31,7 +31,7 @@ "outerColor": [43,81,98], "innerColor": [201,248,255], "uniqueName": "Ingenuity", - "uniques": ["Free [Great Scientist] appears ", "[Great Scientist] is earned [50]% faster"], + "uniques": ["Free [Great Scientist] appears ", "[Great Scientist] is earned [50]% faster"], "cities": ["Babylon","Akkad","Dur-Kurigalzu","Nippur","Borsippa","Sippar","Opis","Mari","Shushan","Eshnunna", "Ellasar","Erech","Kutha","Sirpurla","Neribtum","Ashur","Ninveh","Nimrud","Arbela","Nuzi", "Arrapkha","Tutub","Shaduppum","Rapiqum","Mashkan Shapir","Tuttul","Ramad","Ana","Haradum","Agrab", diff --git a/android/assets/jsons/Civ V - Vanilla/TileResources.json b/android/assets/jsons/Civ V - Vanilla/TileResources.json index b27bb5f97e..b75a52d986 100644 --- a/android/assets/jsons/Civ V - Vanilla/TileResources.json +++ b/android/assets/jsons/Civ V - Vanilla/TileResources.json @@ -7,8 +7,8 @@ "food": 1, "improvement": "Pasture", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [18] tiles ", - "Generated on every [22] tiles "] + "uniques": ["Generated on every [18] tiles ", + "Generated on every [22] tiles "] }, { "name": "Sheep", @@ -27,11 +27,11 @@ "food": 1, "improvement": "Camp", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [8] tiles ", - "Generated on every [12] tiles ", - "Generated on every [25] tiles ", - "Generated on every [25] tiles ", - "Generated on every [16] tiles ", + "uniques": ["Generated on every [8] tiles ", + "Generated on every [12] tiles ", + "Generated on every [25] tiles ", + "Generated on every [25] tiles ", + "Generated on every [16] tiles ", "Generated on every [28] tiles "] }, { @@ -51,10 +51,10 @@ "food": 1, "improvement": "Farm", "improvementStats": {"food": 1}, - "uniques": ["Generated on every [27] tiles ", - "Generated on every [10] tiles ", - "Generated on every [20] tiles ", - "Generated on every [20] tiles "] + "uniques": ["Generated on every [27] tiles ", + "Generated on every [10] tiles ", + "Generated on every [20] tiles ", + "Generated on every [20] tiles "] }, { "name": "Stone", @@ -63,9 +63,9 @@ "production": 1, "improvement": "Quarry", "improvementStats": {"production": 1}, - "uniques": ["Generated on every [20] tiles ", - "Generated on every [15] tiles ", - "Generated on every [19] tiles "] + "uniques": ["Generated on every [20] tiles ", + "Generated on every [15] tiles ", + "Generated on every [19] tiles "] }, { "name": "Fish", @@ -74,7 +74,7 @@ "food": 1, "improvement": "Fishing Boats", "improvementStats": {"food": 1}, - "uniques": ["Generated on every [10] tiles "] + "uniques": ["Generated on every [10] tiles "] }, /* { @@ -97,13 +97,13 @@ "improvement": "Pasture", "improvementStats": {"production": 1}, "uniques": ["Guaranteed with Strategic Balance resource option", - "Generated with weight [100] ", - "Generated with weight [100] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [100] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] "], + "Generated with weight [100] ", + "Generated with weight [100] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [100] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [30] "], "majorDepositAmount": {"sparse": 4, "default": 4, "abundant": 6}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -116,19 +116,19 @@ "improvement": "Mine", "improvementStats": {"production": 1}, "uniques": ["Guaranteed with Strategic Balance resource option", - "Generated with weight [45] ", - "Generated with weight [25] ", - "Generated with weight [35] ", + "Generated with weight [45] ", + "Generated with weight [25] ", + "Generated with weight [35] ", "Generated with weight [26] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [20] ", "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 4, "default": 6, "abundant": 9}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -146,11 +146,11 @@ "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [10] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [30] ", - "Minor deposits generated with weight [30] "], + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [30] ", + "Minor deposits generated with weight [30] "], "majorDepositAmount": {"sparse": 5, "default": 7, "abundant": 10}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -165,15 +165,15 @@ "uniques": ["Deposits in [Coast] tiles always provide [4] resources", "Guaranteed with Strategic Balance resource option", "Generated with weight [65] ", - "Generated with weight [40] ", - "Generated with weight [60] ", - "Generated with weight [65] ", - "Generated with weight [100] ", + "Generated with weight [40] ", + "Generated with weight [60] ", + "Generated with weight [65] ", + "Generated with weight [100] ", "Minor deposits generated with weight [20] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [20] "], + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [20] ", + "Minor deposits generated with weight [20] "], "majorDepositAmount": {"sparse": 5, "default": 7, "abundant": 9}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -185,11 +185,11 @@ "production": 1, "improvement": "Mine", "improvementStats": {"production": 2}, - "uniques": ["Generated with weight [15] ", - "Generated with weight [15] ", + "uniques": ["Generated with weight [15] ", + "Generated with weight [15] ", "Generated with weight [39] ", "Minor deposits generated with weight [20] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 5, "default": 8, "abundant": 10}, "minorDepositAmount": {"sparse": 2, "default": 3, "abundant": 3} }, @@ -205,8 +205,8 @@ "Generated with weight [70] ", "Generated with weight [70] ", "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] ", - "Minor deposits generated with weight [10] "], + "Minor deposits generated with weight [10] ", + "Minor deposits generated with weight [10] "], "majorDepositAmount": {"sparse": 2, "default": 4, "abundant": 4}, "minorDepositAmount": {"sparse": 1, "default": 2, "abundant": 3} }, @@ -293,9 +293,9 @@ "Generated near City States with weight [10]", "Doesn't generate naturally ", "Doesn't generate naturally ", - "Doesn't generate naturally ", - "Doesn't generate naturally ", - "Doesn't generate naturally " + "Doesn't generate naturally ", + "Doesn't generate naturally ", + "Doesn't generate naturally " ] }, { @@ -320,7 +320,7 @@ "uniques": ["Generated with weight [35] ", "Generated with weight [15] ", "Generated near City States with weight [10]", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Silk", @@ -349,7 +349,7 @@ "Generated with weight [5] ", "Generated near City States with weight [15]", "Doesn't generate naturally ", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Wine", @@ -386,7 +386,7 @@ "improvementStats": {"production": 1}, "uniques": ["[+15]% Production when constructing [All] wonders [in this city]", "Special placement during map generation", - "Doesn't generate naturally "] + "Doesn't generate naturally "] }, { "name": "Whales", diff --git a/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt b/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt index 63943404cb..d6cd928dba 100644 --- a/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt +++ b/core/src/com/unciv/models/ruleset/validation/UniqueValidator.kt @@ -203,7 +203,7 @@ class UniqueValidator(val ruleset: Ruleset) { } /** Maps uncompliant parameters to their required types */ - private fun getComplianceErrors( + private fun getComplianceErrors( unique: Unique, ): List { if (unique.type == null) return emptyList()