# THIS FILE WAS AUTOMATICALLY GENERATED BY "generate_dicts_from_data_json.py" DO NOT CHANGE MANUALLY!
# ANY CHANGE WILL BE OVERWRITTEN

# from sc2.ids.buff_id import BuffId
# from sc2.ids.effect_id import EffectId
from typing import Union

from sc2.ids.ability_id import AbilityId
from sc2.ids.unit_typeid import UnitTypeId

TRAIN_INFO: dict[UnitTypeId, dict[UnitTypeId, dict[str, Union[AbilityId, bool, UnitTypeId]]]] = {
    UnitTypeId.BARRACKS: {
        UnitTypeId.GHOST: {
            "ability": AbilityId.BARRACKSTRAIN_GHOST,
            "requires_techlab": True,
            "required_building": UnitTypeId.GHOSTACADEMY,
        },
        UnitTypeId.MARAUDER: {"ability": AbilityId.BARRACKSTRAIN_MARAUDER, "requires_techlab": True},
        UnitTypeId.MARINE: {"ability": AbilityId.BARRACKSTRAIN_MARINE},
        UnitTypeId.REAPER: {"ability": AbilityId.BARRACKSTRAIN_REAPER},
    },
    UnitTypeId.COMMANDCENTER: {
        UnitTypeId.ORBITALCOMMAND: {
            "ability": AbilityId.UPGRADETOORBITAL_ORBITALCOMMAND,
            "required_building": UnitTypeId.BARRACKS,
        },
        UnitTypeId.PLANETARYFORTRESS: {
            "ability": AbilityId.UPGRADETOPLANETARYFORTRESS_PLANETARYFORTRESS,
            "required_building": UnitTypeId.ENGINEERINGBAY,
        },
        UnitTypeId.SCV: {"ability": AbilityId.COMMANDCENTERTRAIN_SCV},
    },
    UnitTypeId.CORRUPTOR: {
        UnitTypeId.BROODLORD: {
            "ability": AbilityId.MORPHTOBROODLORD_BROODLORD,
            "required_building": UnitTypeId.GREATERSPIRE,
        }
    },
    UnitTypeId.CREEPTUMOR: {
        UnitTypeId.CREEPTUMOR: {"ability": AbilityId.BUILD_CREEPTUMOR_TUMOR, "requires_placement_position": True}
    },
    UnitTypeId.CREEPTUMORBURROWED: {
        UnitTypeId.CREEPTUMOR: {"ability": AbilityId.BUILD_CREEPTUMOR, "requires_placement_position": True}
    },
    UnitTypeId.DRONE: {
        UnitTypeId.BANELINGNEST: {
            "ability": AbilityId.ZERGBUILD_BANELINGNEST,
            "required_building": UnitTypeId.SPAWNINGPOOL,
            "requires_placement_position": True,
        },
        UnitTypeId.EVOLUTIONCHAMBER: {
            "ability": AbilityId.ZERGBUILD_EVOLUTIONCHAMBER,
            "required_building": UnitTypeId.HATCHERY,
            "requires_placement_position": True,
        },
        UnitTypeId.EXTRACTOR: {"ability": AbilityId.ZERGBUILD_EXTRACTOR},
        UnitTypeId.HATCHERY: {"ability": AbilityId.ZERGBUILD_HATCHERY, "requires_placement_position": True},
        UnitTypeId.HYDRALISKDEN: {
            "ability": AbilityId.ZERGBUILD_HYDRALISKDEN,
            "required_building": UnitTypeId.LAIR,
            "requires_placement_position": True,
        },
        UnitTypeId.INFESTATIONPIT: {
            "ability": AbilityId.ZERGBUILD_INFESTATIONPIT,
            "required_building": UnitTypeId.LAIR,
            "requires_placement_position": True,
        },
        UnitTypeId.LURKERDENMP: {
            "ability": AbilityId.BUILD_LURKERDEN,
            "required_building": UnitTypeId.HYDRALISKDEN,
            "requires_placement_position": True,
        },
        UnitTypeId.NYDUSNETWORK: {
            "ability": AbilityId.ZERGBUILD_NYDUSNETWORK,
            "required_building": UnitTypeId.LAIR,
            "requires_placement_position": True,
        },
        UnitTypeId.ROACHWARREN: {
            "ability": AbilityId.ZERGBUILD_ROACHWARREN,
            "required_building": UnitTypeId.SPAWNINGPOOL,
            "requires_placement_position": True,
        },
        UnitTypeId.SPAWNINGPOOL: {
            "ability": AbilityId.ZERGBUILD_SPAWNINGPOOL,
            "required_building": UnitTypeId.HATCHERY,
            "requires_placement_position": True,
        },
        UnitTypeId.SPINECRAWLER: {
            "ability": AbilityId.ZERGBUILD_SPINECRAWLER,
            "required_building": UnitTypeId.SPAWNINGPOOL,
            "requires_placement_position": True,
        },
        UnitTypeId.SPIRE: {
            "ability": AbilityId.ZERGBUILD_SPIRE,
            "required_building": UnitTypeId.LAIR,
            "requires_placement_position": True,
        },
        UnitTypeId.SPORECRAWLER: {
            "ability": AbilityId.ZERGBUILD_SPORECRAWLER,
            "required_building": UnitTypeId.SPAWNINGPOOL,
            "requires_placement_position": True,
        },
        UnitTypeId.ULTRALISKCAVERN: {
            "ability": AbilityId.ZERGBUILD_ULTRALISKCAVERN,
            "required_building": UnitTypeId.HIVE,
            "requires_placement_position": True,
        },
    },
    UnitTypeId.FACTORY: {
        UnitTypeId.CYCLONE: {"ability": AbilityId.TRAIN_CYCLONE, "requires_techlab": True},
        UnitTypeId.HELLION: {"ability": AbilityId.FACTORYTRAIN_HELLION},
        UnitTypeId.HELLIONTANK: {"ability": AbilityId.TRAIN_HELLBAT, "required_building": UnitTypeId.ARMORY},
        UnitTypeId.SIEGETANK: {"ability": AbilityId.FACTORYTRAIN_SIEGETANK, "requires_techlab": True},
        UnitTypeId.THOR: {
            "ability": AbilityId.FACTORYTRAIN_THOR,
            "requires_techlab": True,
            "required_building": UnitTypeId.ARMORY,
        },
        UnitTypeId.WIDOWMINE: {"ability": AbilityId.FACTORYTRAIN_WIDOWMINE},
    },
    UnitTypeId.GATEWAY: {
        UnitTypeId.ADEPT: {
            "ability": AbilityId.TRAIN_ADEPT,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_power": True,
        },
        UnitTypeId.DARKTEMPLAR: {
            "ability": AbilityId.GATEWAYTRAIN_DARKTEMPLAR,
            "required_building": UnitTypeId.DARKSHRINE,
            "requires_power": True,
        },
        UnitTypeId.HIGHTEMPLAR: {
            "ability": AbilityId.GATEWAYTRAIN_HIGHTEMPLAR,
            "required_building": UnitTypeId.TEMPLARARCHIVE,
            "requires_power": True,
        },
        UnitTypeId.SENTRY: {
            "ability": AbilityId.GATEWAYTRAIN_SENTRY,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_power": True,
        },
        UnitTypeId.STALKER: {
            "ability": AbilityId.GATEWAYTRAIN_STALKER,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_power": True,
        },
        UnitTypeId.ZEALOT: {"ability": AbilityId.GATEWAYTRAIN_ZEALOT, "requires_power": True},
    },
    UnitTypeId.HATCHERY: {
        UnitTypeId.LAIR: {"ability": AbilityId.UPGRADETOLAIR_LAIR, "required_building": UnitTypeId.SPAWNINGPOOL},
        UnitTypeId.QUEEN: {"ability": AbilityId.TRAINQUEEN_QUEEN, "required_building": UnitTypeId.SPAWNINGPOOL},
    },
    UnitTypeId.HIVE: {
        UnitTypeId.QUEEN: {"ability": AbilityId.TRAINQUEEN_QUEEN, "required_building": UnitTypeId.SPAWNINGPOOL}
    },
    UnitTypeId.HYDRALISK: {
        UnitTypeId.LURKERMP: {"ability": AbilityId.MORPH_LURKER, "required_building": UnitTypeId.LURKERDENMP}
    },
    UnitTypeId.LAIR: {
        UnitTypeId.HIVE: {"ability": AbilityId.UPGRADETOHIVE_HIVE, "required_building": UnitTypeId.INFESTATIONPIT},
        UnitTypeId.QUEEN: {"ability": AbilityId.TRAINQUEEN_QUEEN, "required_building": UnitTypeId.SPAWNINGPOOL},
    },
    UnitTypeId.LARVA: {
        UnitTypeId.CORRUPTOR: {"ability": AbilityId.LARVATRAIN_CORRUPTOR, "required_building": UnitTypeId.SPIRE},
        UnitTypeId.DRONE: {"ability": AbilityId.LARVATRAIN_DRONE},
        UnitTypeId.HYDRALISK: {"ability": AbilityId.LARVATRAIN_HYDRALISK, "required_building": UnitTypeId.HYDRALISKDEN},
        UnitTypeId.INFESTOR: {"ability": AbilityId.LARVATRAIN_INFESTOR, "required_building": UnitTypeId.INFESTATIONPIT},
        UnitTypeId.MUTALISK: {"ability": AbilityId.LARVATRAIN_MUTALISK, "required_building": UnitTypeId.SPIRE},
        UnitTypeId.OVERLORD: {"ability": AbilityId.LARVATRAIN_OVERLORD},
        UnitTypeId.ROACH: {"ability": AbilityId.LARVATRAIN_ROACH, "required_building": UnitTypeId.ROACHWARREN},
        UnitTypeId.SWARMHOSTMP: {"ability": AbilityId.TRAIN_SWARMHOST, "required_building": UnitTypeId.INFESTATIONPIT},
        UnitTypeId.ULTRALISK: {
            "ability": AbilityId.LARVATRAIN_ULTRALISK,
            "required_building": UnitTypeId.ULTRALISKCAVERN,
        },
        UnitTypeId.VIPER: {"ability": AbilityId.LARVATRAIN_VIPER, "required_building": UnitTypeId.HIVE},
        UnitTypeId.ZERGLING: {"ability": AbilityId.LARVATRAIN_ZERGLING, "required_building": UnitTypeId.SPAWNINGPOOL},
    },
    UnitTypeId.NEXUS: {
        UnitTypeId.MOTHERSHIP: {
            "ability": AbilityId.NEXUSTRAINMOTHERSHIP_MOTHERSHIP,
            "required_building": UnitTypeId.FLEETBEACON,
        },
        UnitTypeId.PROBE: {"ability": AbilityId.NEXUSTRAIN_PROBE},
    },
    UnitTypeId.NYDUSNETWORK: {
        UnitTypeId.NYDUSCANAL: {"ability": AbilityId.BUILD_NYDUSWORM, "requires_placement_position": True}
    },
    UnitTypeId.ORACLE: {
        UnitTypeId.ORACLESTASISTRAP: {"ability": AbilityId.BUILD_STASISTRAP, "requires_placement_position": True}
    },
    UnitTypeId.ORBITALCOMMAND: {UnitTypeId.SCV: {"ability": AbilityId.COMMANDCENTERTRAIN_SCV}},
    UnitTypeId.OVERLORD: {
        UnitTypeId.OVERLORDTRANSPORT: {
            "ability": AbilityId.MORPH_OVERLORDTRANSPORT,
            "required_building": UnitTypeId.LAIR,
        },
        UnitTypeId.OVERSEER: {"ability": AbilityId.MORPH_OVERSEER, "required_building": UnitTypeId.LAIR},
    },
    UnitTypeId.OVERLORDTRANSPORT: {
        UnitTypeId.OVERSEER: {"ability": AbilityId.MORPH_OVERSEER, "required_building": UnitTypeId.LAIR}
    },
    UnitTypeId.OVERSEER: {UnitTypeId.CHANGELING: {"ability": AbilityId.SPAWNCHANGELING_SPAWNCHANGELING}},
    UnitTypeId.OVERSEERSIEGEMODE: {UnitTypeId.CHANGELING: {"ability": AbilityId.SPAWNCHANGELING_SPAWNCHANGELING}},
    UnitTypeId.PLANETARYFORTRESS: {UnitTypeId.SCV: {"ability": AbilityId.COMMANDCENTERTRAIN_SCV}},
    UnitTypeId.PROBE: {
        UnitTypeId.ASSIMILATOR: {"ability": AbilityId.PROTOSSBUILD_ASSIMILATOR},
        UnitTypeId.CYBERNETICSCORE: {
            "ability": AbilityId.PROTOSSBUILD_CYBERNETICSCORE,
            "required_building": UnitTypeId.GATEWAY,
            "requires_placement_position": True,
        },
        UnitTypeId.DARKSHRINE: {
            "ability": AbilityId.PROTOSSBUILD_DARKSHRINE,
            "required_building": UnitTypeId.TWILIGHTCOUNCIL,
            "requires_placement_position": True,
        },
        UnitTypeId.FLEETBEACON: {
            "ability": AbilityId.PROTOSSBUILD_FLEETBEACON,
            "required_building": UnitTypeId.STARGATE,
            "requires_placement_position": True,
        },
        UnitTypeId.FORGE: {
            "ability": AbilityId.PROTOSSBUILD_FORGE,
            "required_building": UnitTypeId.PYLON,
            "requires_placement_position": True,
        },
        UnitTypeId.GATEWAY: {
            "ability": AbilityId.PROTOSSBUILD_GATEWAY,
            "required_building": UnitTypeId.PYLON,
            "requires_placement_position": True,
        },
        UnitTypeId.NEXUS: {"ability": AbilityId.PROTOSSBUILD_NEXUS, "requires_placement_position": True},
        UnitTypeId.PHOTONCANNON: {
            "ability": AbilityId.PROTOSSBUILD_PHOTONCANNON,
            "required_building": UnitTypeId.FORGE,
            "requires_placement_position": True,
        },
        UnitTypeId.PYLON: {"ability": AbilityId.PROTOSSBUILD_PYLON, "requires_placement_position": True},
        UnitTypeId.ROBOTICSBAY: {
            "ability": AbilityId.PROTOSSBUILD_ROBOTICSBAY,
            "required_building": UnitTypeId.ROBOTICSFACILITY,
            "requires_placement_position": True,
        },
        UnitTypeId.ROBOTICSFACILITY: {
            "ability": AbilityId.PROTOSSBUILD_ROBOTICSFACILITY,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
        },
        UnitTypeId.SHIELDBATTERY: {
            "ability": AbilityId.BUILD_SHIELDBATTERY,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
        },
        UnitTypeId.STARGATE: {
            "ability": AbilityId.PROTOSSBUILD_STARGATE,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
        },
        UnitTypeId.TEMPLARARCHIVE: {
            "ability": AbilityId.PROTOSSBUILD_TEMPLARARCHIVE,
            "required_building": UnitTypeId.TWILIGHTCOUNCIL,
            "requires_placement_position": True,
        },
        UnitTypeId.TWILIGHTCOUNCIL: {
            "ability": AbilityId.PROTOSSBUILD_TWILIGHTCOUNCIL,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
        },
    },
    UnitTypeId.QUEEN: {
        UnitTypeId.CREEPTUMOR: {"ability": AbilityId.BUILD_CREEPTUMOR, "requires_placement_position": True},
        UnitTypeId.CREEPTUMORQUEEN: {"ability": AbilityId.BUILD_CREEPTUMOR_QUEEN, "requires_placement_position": True},
    },
    UnitTypeId.RAVEN: {UnitTypeId.AUTOTURRET: {"ability": AbilityId.BUILDAUTOTURRET_AUTOTURRET}},
    UnitTypeId.ROACH: {
        UnitTypeId.RAVAGER: {"ability": AbilityId.MORPHTORAVAGER_RAVAGER, "required_building": UnitTypeId.HATCHERY}
    },
    UnitTypeId.ROBOTICSFACILITY: {
        UnitTypeId.COLOSSUS: {
            "ability": AbilityId.ROBOTICSFACILITYTRAIN_COLOSSUS,
            "required_building": UnitTypeId.ROBOTICSBAY,
            "requires_power": True,
        },
        UnitTypeId.DISRUPTOR: {
            "ability": AbilityId.TRAIN_DISRUPTOR,
            "required_building": UnitTypeId.ROBOTICSBAY,
            "requires_power": True,
        },
        UnitTypeId.IMMORTAL: {"ability": AbilityId.ROBOTICSFACILITYTRAIN_IMMORTAL, "requires_power": True},
        UnitTypeId.OBSERVER: {"ability": AbilityId.ROBOTICSFACILITYTRAIN_OBSERVER, "requires_power": True},
        UnitTypeId.WARPPRISM: {"ability": AbilityId.ROBOTICSFACILITYTRAIN_WARPPRISM, "requires_power": True},
    },
    UnitTypeId.SCV: {
        UnitTypeId.ARMORY: {
            "ability": AbilityId.TERRANBUILD_ARMORY,
            "required_building": UnitTypeId.FACTORY,
            "requires_placement_position": True,
        },
        UnitTypeId.BARRACKS: {
            "ability": AbilityId.TERRANBUILD_BARRACKS,
            "required_building": UnitTypeId.SUPPLYDEPOT,
            "requires_placement_position": True,
        },
        UnitTypeId.BUNKER: {
            "ability": AbilityId.TERRANBUILD_BUNKER,
            "required_building": UnitTypeId.BARRACKS,
            "requires_placement_position": True,
        },
        UnitTypeId.COMMANDCENTER: {"ability": AbilityId.TERRANBUILD_COMMANDCENTER, "requires_placement_position": True},
        UnitTypeId.ENGINEERINGBAY: {
            "ability": AbilityId.TERRANBUILD_ENGINEERINGBAY,
            "required_building": UnitTypeId.COMMANDCENTER,
            "requires_placement_position": True,
        },
        UnitTypeId.FACTORY: {
            "ability": AbilityId.TERRANBUILD_FACTORY,
            "required_building": UnitTypeId.BARRACKS,
            "requires_placement_position": True,
        },
        UnitTypeId.FUSIONCORE: {
            "ability": AbilityId.TERRANBUILD_FUSIONCORE,
            "required_building": UnitTypeId.STARPORT,
            "requires_placement_position": True,
        },
        UnitTypeId.GHOSTACADEMY: {
            "ability": AbilityId.TERRANBUILD_GHOSTACADEMY,
            "required_building": UnitTypeId.BARRACKS,
            "requires_placement_position": True,
        },
        UnitTypeId.MISSILETURRET: {
            "ability": AbilityId.TERRANBUILD_MISSILETURRET,
            "required_building": UnitTypeId.ENGINEERINGBAY,
            "requires_placement_position": True,
        },
        UnitTypeId.REFINERY: {"ability": AbilityId.TERRANBUILD_REFINERY},
        UnitTypeId.SENSORTOWER: {
            "ability": AbilityId.TERRANBUILD_SENSORTOWER,
            "required_building": UnitTypeId.ENGINEERINGBAY,
            "requires_placement_position": True,
        },
        UnitTypeId.STARPORT: {
            "ability": AbilityId.TERRANBUILD_STARPORT,
            "required_building": UnitTypeId.FACTORY,
            "requires_placement_position": True,
        },
        UnitTypeId.SUPPLYDEPOT: {"ability": AbilityId.TERRANBUILD_SUPPLYDEPOT, "requires_placement_position": True},
    },
    UnitTypeId.SPIRE: {
        UnitTypeId.GREATERSPIRE: {
            "ability": AbilityId.UPGRADETOGREATERSPIRE_GREATERSPIRE,
            "required_building": UnitTypeId.HIVE,
        }
    },
    UnitTypeId.STARGATE: {
        UnitTypeId.CARRIER: {
            "ability": AbilityId.STARGATETRAIN_CARRIER,
            "required_building": UnitTypeId.FLEETBEACON,
            "requires_power": True,
        },
        UnitTypeId.ORACLE: {"ability": AbilityId.STARGATETRAIN_ORACLE, "requires_power": True},
        UnitTypeId.PHOENIX: {"ability": AbilityId.STARGATETRAIN_PHOENIX, "requires_power": True},
        UnitTypeId.TEMPEST: {
            "ability": AbilityId.STARGATETRAIN_TEMPEST,
            "required_building": UnitTypeId.FLEETBEACON,
            "requires_power": True,
        },
        UnitTypeId.VOIDRAY: {"ability": AbilityId.STARGATETRAIN_VOIDRAY, "requires_power": True},
    },
    UnitTypeId.STARPORT: {
        UnitTypeId.BANSHEE: {"ability": AbilityId.STARPORTTRAIN_BANSHEE, "requires_techlab": True},
        UnitTypeId.BATTLECRUISER: {
            "ability": AbilityId.STARPORTTRAIN_BATTLECRUISER,
            "requires_techlab": True,
            "required_building": UnitTypeId.FUSIONCORE,
        },
        UnitTypeId.LIBERATOR: {"ability": AbilityId.STARPORTTRAIN_LIBERATOR},
        UnitTypeId.MEDIVAC: {"ability": AbilityId.STARPORTTRAIN_MEDIVAC},
        UnitTypeId.RAVEN: {"ability": AbilityId.STARPORTTRAIN_RAVEN, "requires_techlab": True},
        UnitTypeId.VIKINGFIGHTER: {"ability": AbilityId.STARPORTTRAIN_VIKINGFIGHTER},
    },
    UnitTypeId.SWARMHOSTBURROWEDMP: {UnitTypeId.LOCUSTMPFLYING: {"ability": AbilityId.EFFECT_SPAWNLOCUSTS}},
    UnitTypeId.SWARMHOSTMP: {UnitTypeId.LOCUSTMPFLYING: {"ability": AbilityId.EFFECT_SPAWNLOCUSTS}},
    UnitTypeId.WARPGATE: {
        UnitTypeId.ADEPT: {
            "ability": AbilityId.TRAINWARP_ADEPT,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
            "requires_power": True,
        },
        UnitTypeId.DARKTEMPLAR: {
            "ability": AbilityId.WARPGATETRAIN_DARKTEMPLAR,
            "required_building": UnitTypeId.DARKSHRINE,
            "requires_placement_position": True,
            "requires_power": True,
        },
        UnitTypeId.HIGHTEMPLAR: {
            "ability": AbilityId.WARPGATETRAIN_HIGHTEMPLAR,
            "required_building": UnitTypeId.TEMPLARARCHIVE,
            "requires_placement_position": True,
            "requires_power": True,
        },
        UnitTypeId.SENTRY: {
            "ability": AbilityId.WARPGATETRAIN_SENTRY,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
            "requires_power": True,
        },
        UnitTypeId.STALKER: {
            "ability": AbilityId.WARPGATETRAIN_STALKER,
            "required_building": UnitTypeId.CYBERNETICSCORE,
            "requires_placement_position": True,
            "requires_power": True,
        },
        UnitTypeId.ZEALOT: {
            "ability": AbilityId.WARPGATETRAIN_ZEALOT,
            "requires_placement_position": True,
            "requires_power": True,
        },
    },
    UnitTypeId.ZERGLING: {
        UnitTypeId.BANELING: {
            "ability": AbilityId.MORPHTOBANELING_BANELING,
            "required_building": UnitTypeId.BANELINGNEST,
        }
    },
}
