Closed merfolk closed 4 years ago
might as well solve the morph problem too with upgrades something like this:
equiv_structures = {
UnitTypeId.SPIRE: {UnitTypeId.SPIRE, UnitTypeId.GREATERSPIRE},
UnitTypeId.GREATERSPIRE: {UnitTypeId.SPIRE, UnitTypeId.GREATERSPIRE},
UnitTypeId.HATCHERY: {UnitTypeId.HATCHERY, UnitTypeId.LAIR, UnitTypeId.HIVE},
UnitTypeId.LAIR: {UnitTypeId.HATCHERY, UnitTypeId.LAIR, UnitTypeId.HIVE},
UnitTypeId.HIVE: {UnitTypeId.HATCHERY, UnitTypeId.LAIR, UnitTypeId.HIVE},
}
Could also use the BotAI.research(self, upgrade_type: UpgradeId) -> bool
method in Burny's python-sc2 to take care of that.
from_building parameter can still be provided for backwards compatibility and possible SC2 version mismatches.
There may be some problems with eg. upgrades from SPIRE and GREATERSPIRE. But again, if problems occur, the building type can always be explicitly specified.