M
MagnumVulcanos
Guest
The question is self explanatory, I want to do something for every value in an enum.
Sadly enums aren't lists, and there's no java-like method like the following:
My current solution is this:
And when I do need to use them and do somthing for each of them, I just use the list for it. Am I missing a function that returns all values in an enum?
Sadly enums aren't lists, and there's no java-like method like the following:
Code:
for ( value in enum ) {
do thing with value
}
Code:
enum gases { carbon_dioxide, oxygen, nitrogen }
global.gases_listed = ds_list_create();
global.gases_listed[|0] = gases.carbon_dioxide;
global.gases_listed[|1] = gases.oxygen;
global.gases_listed[|2] = gases.nitrogen;
Last edited by a moderator: