Esempio n. 1
0
bool BuildOrderManager::hasResources(BWAPI::TechType t, int time)
{
  pair<int, Resources> res;
  res.first=time;
  res.second.minerals=t.mineralPrice();
  res.second.gas=t.gasPrice();
  return hasResources(res);
}
Esempio n. 2
0
bool BuildOrderManager::hasResources(BWAPI::TechType t)
{
  if (BWAPI::Broodwar->self()->cumulativeMinerals()-this->usedMinerals<t.mineralPrice())
    return false;
  if (BWAPI::Broodwar->self()->cumulativeGas()-this->usedGas<t.gasPrice())
    return false;
  return true;
}
Esempio n. 3
0
void BuildOrderManager::spendResources(BWAPI::TechType t)
{
  this->usedMinerals+=t.mineralPrice();
  this->usedGas+=t.gasPrice();
}
Esempio n. 4
0
Resources::Resources(BWAPI::TechType type)
{
  minerals = type.mineralPrice();
  gas      = type.gasPrice();
  supply   = 0.0;
}