This function returns how much population space the given proto unit provides
when it's on the map. If the proto unit doesn't provide any population space,
the function returns 0.
ruleBuildHousesSpanishactiveminInterval5{// Try to always have at least 10 population slots available.// Get the current population capacity.intcurrentPopCap=kbGetPopCap();// Get the current population count.intcurrentPopCount=kbGetPop();// Get the population space provided by a house.intpopCapAddition=kbGetPopCapAddition(cMyID,cUnitTypeHouseMed);// Calculate how many houses we need to build to have 10 population// slots available.inthousesToBuild=(currentPopCount+popCapAddition-currentPopCap)/popCapAddition;// Don't continue if we don't need to build any houses.if(housesToBuild<=0){return;}// Here the rest of the rule for building houses (irrelevant for this example)}