Added test for branches which require missing eras

This commit is contained in:
Yair Morgenstern 2022-06-13 21:39:57 +03:00
parent ec6b4dc017
commit 86f2560d7e
2 changed files with 6 additions and 1 deletions

View File

@ -3,5 +3,5 @@ package com.unciv.models.ruleset
class PolicyBranch : Policy() {
var policies: ArrayList<Policy> = arrayListOf()
var priorities: HashMap<String, Int> = HashMap()
lateinit var era: String
var era: String = ""
}

View File

@ -813,6 +813,11 @@ class Ruleset {
checkUniques(policy, lines, rulesetSpecific, forOptionsPopup)
}
for (branch in policyBranches.values)
if (branch.era !in eras)
lines += "${branch.name} requires era ${branch.era} which does not exist!"
for (policy in policyBranches.values.flatMap { it.policies + it })
if (policy != policies[policy.name])
lines += "More than one policy with the name ${policy.name} exists!"