Пример #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);
}
Пример #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;
}
Пример #3
0
void BuildOrderManager::spendResources(BWAPI::TechType t)
{
  this->usedMinerals+=t.mineralPrice();
  this->usedGas+=t.gasPrice();
}
Пример #4
0
Resources::Resources(BWAPI::TechType type)
{
  minerals = type.mineralPrice();
  gas      = type.gasPrice();
  supply   = 0.0;
}