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); }
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; }
void BuildOrderManager::spendResources(BWAPI::TechType t) { this->usedMinerals+=t.mineralPrice(); this->usedGas+=t.gasPrice(); }
Resources::Resources(BWAPI::TechType type) { minerals = type.mineralPrice(); gas = type.gasPrice(); supply = 0.0; }