Exemplo n.º 1
0
// 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();
}
Exemplo n.º 2
0
ResearchTest::ResearchTest(BWAPI::TechType techType) : techType(techType),
                                                       researcher(NULL),
                                                       startResearchFrame(-1),
                                                       nextUpdateFrame(-1)
{
  fail = false;
  running = false;
  researcherType = techType.whatResearches();
  BWAssertF(researcherType!=UnitTypes::None,{fail=true;return;});
Exemplo n.º 3
0
bool CheeseStrategies::StandardPlay::startTech(BWAPI::TechType tech) {
   UnitType techBuildingType = tech.whatResearches();

    if (Broodwar->self()->completedUnitCount(techBuildingType) == 0) {
        return false;
    }

    UnitSet myUnits = BWAPI::Broodwar->self()->getUnits();
    UnitSet::iterator it;

    BWAPI::Unit* techBuilding;

    for (it=myUnits.begin(); it!=myUnits.end(); it++) {
        if ((*it)->getType() == techBuildingType) {
            techBuilding = (*it);
        }
    }

    return techBuilding->research(tech);
}
bool TechManager::research(BWAPI::TechType type)
{
  researchQueues[*type.whatResearches()].push_back(type);
  plannedTech.insert(type);
  return true;
}