Пример #1
0
bool ResourceManager::hasResources(int neededMinerals, int neededGas)
{
	if (Broodwar->self()->minerals() - calcLockedMinerals() >= neededMinerals)
	{
		if (Broodwar->self()->gas() - calcLockedGas() >= neededGas)
		{
			return true;
		}
	}
	return false;
}
Пример #2
0
bool ResourceManager::hasResources(int neededMinerals, int neededGas, bool isExpand)
{
	if (!isExpand)
	{
		UnitType baseType = Broodwar->self()->getRace().getCenter();
		if (BuildPlanner::getInstance()->nextIsOfType(baseType))
		{
			neededMinerals += baseType.mineralPrice();
		}
	}

	if (Broodwar->self()->minerals() - calcLockedMinerals() >= neededMinerals)
	{
		if (Broodwar->self()->gas() - calcLockedGas() >= neededGas)
		{
			return true;
		}
	}
	return false;
}
Пример #3
0
void ResourceManager::printInfo()
{
	Broodwar->drawTextScreen(5,96, "Locked minerals: %d", calcLockedMinerals());
	Broodwar->drawTextScreen(5,112, "Locked gas: %d", calcLockedGas());
}