Quinn Yee Qin Teh wrote:
/**
* @param res The resource type
* @return count of resources needed of type res
*/
> int Building::neededRessource(int r)
> {
count of needed resources is max stock - actual stock + (weired computation
taking into account that some resources a carried 10 at once. wonder why a
stock of 10/50 oranges should request 50-10+1-10=31 workers but guess this
is not workers but resources needed thus the +1 makes it round up to one
worker when 10 res are needed)
> int need = type->maxRessource[r] - ressources[r] + 1 -
> type->multiplierRessource[r];
return max(need,0);
> }
> 2. If I simply want the exact number of resource r that the building can
> still hold, will it be accurate for me to just use the expression
> "/type->maxRessource[r] - ressources[r]/"?
yes
_______________________________________________
glob2-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/glob2-devel