Steamhammer/Source/StrategyManager.cpp
const MetaPairVector StrategyManager::getZergBuildOrderGoal() const
{
	// the goal to return
	std::vector<MetaPair> goal;

	// These counts include uncompleted units.
	int nLairs = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Lair);
	int nHives = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hive);
	int nHatches = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hatchery)
		+ nLairs + nHives;
	int nDrones = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Drone);
	int nHydras = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hydralisk);

	const int droneMax = 48;             // number of drones not to exceed

	// Simple default strategy as an example in case you want to use this method.
	goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Hydralisk, nHydras + 12));
	if (shouldExpandNow())
	{
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Hatchery, nHatches + 1));
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Drone, std::min(droneMax, nDrones + 10)));
	}
	else
	{
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Drone, std::min(droneMax, nDrones + 2)));
	}

	return goal;
}
// BOSS method of choosing a zerg production plan. UNUSED!
// See freshProductionPlan() for the current method.
BOSS method of choosing a zerg production plan. UNUSED.
See freshProductionPlan() for the current method.
BOSS method of choosing a zerg production plan . UNUSED . See freshProductionPlan () for the current method .
const MetaPairVector StrategyManager::getZergBuildOrderGoal() const
{
	std::vector<MetaPair> goal;
	int nLairs = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Lair);
	int nHives = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hive);
	int nHatches = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hatchery)
		+ nLairs + nHives;
	int nDrones = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Drone);
	int nHydras = UnitUtil::GetAllUnitCount(BWAPI::UnitTypes::Zerg_Hydralisk);
	const int droneMax = 48;             
	goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Hydralisk, nHydras + 12));
	if (shouldExpandNow())
	{
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Hatchery, nHatches + 1));
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Drone, std::min(droneMax, nDrones + 10)));
	}
	else
	{
		goal.push_back(std::pair<MacroAct, int>(BWAPI::UnitTypes::Zerg_Drone, std::min(droneMax, nDrones + 2)));
	}
	return goal;
}
const MetaPairVector StrategyManager :: getZergBuildOrderGoal ( ) const { std :: vector < MetaPair > goal ; int nLairs = UnitUtil :: GetAllUnitCount ( BWAPI :: UnitTypes :: Zerg_Lair ) ; int nHives = UnitUtil :: GetAllUnitCount ( BWAPI :: UnitTypes :: Zerg_Hive ) ; int nHatches = UnitUtil :: GetAllUnitCount ( BWAPI :: UnitTypes :: Zerg_Hatchery ) + nLairs + nHives ; int nDrones = UnitUtil :: GetAllUnitCount ( BWAPI :: UnitTypes :: Zerg_Drone ) ; int nHydras = UnitUtil :: GetAllUnitCount ( BWAPI :: UnitTypes :: Zerg_Hydralisk ) ; const int droneMax = 48 ; goal . push_back ( std :: pair < MacroAct , int > ( BWAPI :: UnitTypes :: Zerg_Hydralisk , nHydras + 12 ) ) ; if ( shouldExpandNow ( ) ) { goal . push_back ( std :: pair < MacroAct , int > ( BWAPI :: UnitTypes :: Zerg_Hatchery , nHatches + 1 ) ) ; goal . push_back ( std :: pair < MacroAct , int > ( BWAPI :: UnitTypes :: Zerg_Drone , std :: min ( droneMax , nDrones + 10 ) ) ) ; } else { goal . push_back ( std :: pair < MacroAct , int > ( BWAPI :: UnitTypes :: Zerg_Drone , std :: min ( droneMax , nDrones + 2 ) ) ) ; } return goal ; }
BOSS method of choosing a zerg production plan.
BOSS method of choosing a zerg production plan .
// the goal to return // These counts include uncompleted units. // number of drones not to exceed // Simple default strategy as an example in case you want to use this method.