// TechType action ActionTypeData::ActionTypeData(BWAPI::TechType t, const ActionID id) : type(TechType) , tech(t) , actionID(id) , raceID(GetRaceID(t.getRace())) , mineralPriceVal(t.mineralPrice() * Constants::RESOURCE_SCALE) , gasPriceVal(t.gasPrice() * Constants::RESOURCE_SCALE) , supplyRequiredVal(0) , supplyProvidedVal(0) , buildTimeVal(t.researchTime()) , numberProduced(1) , name(t.getName()) , metaName(t.getName()) , building(false) , worker(false) , refinery(false) , resourceDepot(false) , supplyProvider(false) , canProduceBool(false) , canAttackBool(false) , whatBuildsUnitType(t.whatResearches()) , addon(false) , reqAddon(false) , reqAddonID(0) , morphed(false) { setShortName(); }
ActionID ActionTypeData::GetActionID(const BWAPI::TechType & type) { const RaceID raceID = GetRaceID(type.getRace()); for (ActionID a(0); a < ActionTypeData::GetNumActionTypes(raceID); ++a) { const ActionTypeData & data = GetActionTypeData(raceID, a); if (data.isTech() && data.getTechType() == type) { return data.getActionID(); } } BOSS_ASSERT(false, "Could not find TechType: %d %s", type.getID(), type.getName().c_str()); return 0; }
MetaType::MetaType (BWAPI::TechType t) : _techType(t) , _type(MetaTypes::Tech) , _race(t.getRace()) { }
ActionTypeData ActionTypeData::GetActionTypeData(const BWAPI::TechType & a) { return GetActionTypeData(GetRaceID(a.getRace()), GetActionID(a)); }