Add BaseUnit.automaticallyUpgradedInProductionToUnitByTech() (#10664)

* Update BaseUnit.kt

* Update RulesetValidator.kt

* Update BasicTests.kt

* Update BaseUnit.kt

* Update TechManager.kt

* Update BaseUnit.kt

* Update BaseUnit.kt
This commit is contained in:
dHannasch
2023-12-17 13:00:45 -07:00
committed by GitHub
parent 18c17e3a18
commit 4b5bb54b72
4 changed files with 23 additions and 8 deletions

View File

@ -63,12 +63,13 @@ class BasicTests {
// If there's a unit that obsoletes with no upgrade then when it obsoletes
// and we try to work on its upgrade, we'll get an exception - see techManager
// But...Scout obsoletes at Scientific Theory with no upgrade...?
@Test
fun allObsoletingUnitsHaveUpgrades() {
val units: Collection<BaseUnit> = ruleset.units.values
var allObsoletingUnitsHaveUpgrades = true
for (unit in units) {
if (unit.techsThatObsoleteThis().any() && unit.upgradesTo == null && unit.name !="Scout" ) {
if (unit.techsAtWhichAutoUpgradeInProduction().any() && unit.upgradesTo == null && unit.name !="Scout" ) {
debug("%s obsoletes but has no upgrade", unit.name)
allObsoletingUnitsHaveUpgrades = false
}