Add GameData parsing optimization
@@ -24,7 +24,8 @@ def split_camel_case(text) -> list:
class GameData(object):
def __init__(self, data):
- self.abilities = {a.ability_id: AbilityData(self, a) for a in data.abilities if AbilityData.id_exists(a.ability_id)}
+ ids = tuple(a.value for a in AbilityId if a.value != 0)
+ self.abilities = {a.ability_id: AbilityData(self, a) for a in data.abilities if a.ability_id in ids}
self.units = {u.unit_id: UnitTypeData(self, u) for u in data.units if u.available}
self.upgrades = {u.upgrade_id: UpgradeData(self, u) for u in data.upgrades}
