Another thing... Is it possible to retrieve a
method from an enum struct which is stored in an ArrayList and then execute it, without getting a full copy of the enum struct? Similar to how Peace-Maker explained retrieving a field on an enum struct stored inside of an ArrayList.
Somewhat pseudo-code:
PHP Code:
enum struct Thing {
int someValue;
void ChangeValue() {
this.someValue = 1234;
}
}
Function MyFunc = arrayListOfThings.Get(0, Thing::ChangeValue);
Call_StartFunction(INVALID_HANDLE, MyFunc);
Instead of
PHP Code:
Thing myThing;
arrayListOfThings.GetArray(0, myThing); // creates a copy
myThing.ChangeValue();
arrayListOfThings.SetArray(0, myThing); // need to do this because the method changes the field on the copy only
Or should I rather just not care / does this approach not make sense, so that I need to stick to the second way of doing it?
EDIT: I just realized that not making a copy of the enum struct before executing it's method would also allow the method to change the enum struct's fields directly. At least that is what I'm hoping for. Updated the examples to reflect what I'm trying to achieve.