Reputation: 131
So the problem is:
How can I change the amount in "Resource Sets" programmatically? I'am planning on changing this value back and forth from 1 and 2 given some conditions during the simulation run.
Amount I want to change is marked in yellow below.
Upvotes: 0
Views: 96
Reputation: 9421
Emile answer is right, but if you insist in using what you are using, you can click on the equal sign and make it a function:
and in the function (which i made take a random number between 1 and 2, but you can do what you want), you use the following (the function returns a type ResourcePool[][])
ResourcePool[][] rp = new ResourcePool[1][num];
for(int i=0;i<num;i++){
rp[0][i]=resourcePool;
}
return rp;
Upvotes: 1
Reputation: 2213
In your case, it seems you are using one resource alternative only.
Why don't you choose units of the same pool
, then the number of units to be seized becomes dynamic.
Upvotes: 1