Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 281 forks source link

Required Upgrade for Building a Unit Type #159

Closed davechurchill closed 7 years ago

davechurchill commented 7 years ago

Right now, each UnitTypeData has a tech_requirement field. However, there are two separate prerequisite types for building units: buildings, and upgrades, for example:

Dark Templar requires a DT shrine to build. Warp Gate requires sc2::UPGRADE_ID::WARPGATERESEARCH to build

I think there should be two separate fields to distinguish this for completeness. Also, tech_requirement is a bit of a misnomer since there aren't any 'techs' in the api, just unit types or upgrades. I suggest that UnitTypeData have the following fields:

required_unittypes = vector of unit types required to build the given unit type required_upgrades = vector of upgrade types required to build the given unit type