From fdb3d698690edfa3f19da83756d426190a78a7fa Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 13 Apr 2020 11:57:49 +0300 Subject: [PATCH] Resolved #2381 - can now remove buildings and units as well, test'D, wiki'D and example'D --- core/src/com/unciv/models/ruleset/Ruleset.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index ce7d7966..21f915cb 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -16,6 +16,8 @@ import kotlin.collections.set class ModOptions { var techsToRemove = HashSet() + var buildingsToRemove = HashSet() + var unitsToRemove = HashSet() } class Ruleset { @@ -51,17 +53,18 @@ class Ruleset { fun add(ruleset: Ruleset) { buildings.putAll(ruleset.buildings) - for(techToRemove in ruleset.modOptions.techsToRemove) technologies.remove(techToRemove) + for(buildingToRemove in ruleset.modOptions.buildingsToRemove) buildings.remove(buildingToRemove) difficulties.putAll(ruleset.difficulties) nations.putAll(ruleset.nations) policyBranches.putAll(ruleset.policyBranches) technologies.putAll(ruleset.technologies) - buildings.putAll(ruleset.buildings) + for(techToRemove in ruleset.modOptions.techsToRemove) technologies.remove(techToRemove) terrains.putAll(ruleset.terrains) tileImprovements.putAll(ruleset.tileImprovements) tileResources.putAll(ruleset.tileResources) unitPromotions.putAll(ruleset.unitPromotions) units.putAll(ruleset.units) + for(unitToRemove in ruleset.modOptions.unitsToRemove) units.remove(unitToRemove) } fun clear() {