FANDOM


Source File: sp_ai.cpp


UINT32 GAI::BuildOrBuyUnits(UINT32 in_iCountry, REAL32 in_fStrength,
EUnitCategory::Enum in_Category)
{
const UINT32 c_iNbBoatsByStrength = 2;
const UINT32 c_iNbPlanesByStrength = 10;
const UINT32 c_iNbGroundsByStrength = 25;

if(in_Category == EUnitCategory::Air)

return BuildAirUnits(in_iCountry, 
max(1,(UINT32)(in_fStrength*c_iNbPlanesByStrength)));

else if(in_Category == EUnitCategory::Naval)

return BuildNavalUnits(in_iCountry, 
max(1,(UINT32)(in_fStrength*c_iNbBoatsByStrength)));

else if(in_Category == EUnitCategory::Ground)

return BuildGroundUnits(in_iCountry, 
max(1,(UINT32)(in_fStrength*c_iNbGroundsByStrength)));

Code first edited by Turbo.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.