Telso
Telso

Reputation: 131

Changing amount of resource sets in Seize-block programmatically

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.

enter image description here

Upvotes: 0

Views: 96

Answers (2)

Felipe
Felipe

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:

resource set

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

Emile Zankoul
Emile Zankoul

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

Related Questions