- Joined
- Feb 15, 2006
- Messages
- 851
Hello fellow vJASSers:
I've been reading some tutorials about optimized structs using the
Now I'm using http://www.hiveworkshop.com/forums/jass-resources-412/snippet-alloc-192348/ to implement these kind of structs.
This is a sample struct:
Everything is fine but I'd like to know if there's an efficient way to loop through all the active instances with the less code possible. I've been looking in this site and I haven't found anything proper. Like this:
Any help would be really appreciated
I've been reading some tutorials about optimized structs using the
struct data extends array
.Now I'm using http://www.hiveworkshop.com/forums/jass-resources-412/snippet-alloc-192348/ to implement these kind of structs.
This is a sample struct:
JASS:
struct test extends array
// here we put more struct components
implement Alloc // this module adds the allocate() and deallocate() methods...
// my custom methods go here...
endstruct
Everything is fine but I'd like to know if there's an efficient way to loop through all the active instances with the less code possible. I've been looking in this site and I haven't found anything proper. Like this:
JASS:
private method Loop takes nothing returns boolean
local thistype this = ????
loop
exitwhen 0==this
// do your stuff
set this = next???
endloop
endmethod
Any help would be really appreciated