Is there a way we can push enum structs with array fields in them into an ArrayList? For example,
PHP Code:
#include <sourcemod>
enum struct Foo {
int x;
int y;
char strTest[32];
int iTest[16];
}
public void OnPluginStart() {
PrintToChatAll("Start");
Foo f;
strcopy(f.strTest, sizeof(f.strTest), "Bar");
f.iTest[0] = 123;
ArrayList arr = new ArrayList();
PrintToChatAll("f.strTest = \"%s\", f.iTest[0] = %d", f.strTest, f.iTest[0]);
arr.PushArray(f, sizeof(f));
Foo copy;
arr.GetArray(0, copy, sizeof(copy));
PrintToChatAll("copy.strTest = \"%s\", copy.iTest[0] = %d", copy.strTest, copy.iTest[0]);
PrintToChatAll("End");
}
has the following output
Code:
Start
f.strTest = "Bar", f.iTest[0] = 123
copy.strTest = "", copy.iTest[0] = 0
End