GFreak45
I didnt slap you, i high 5'd your face.
- Reaction score
- 130
ok, so i know that in order to be able to allocate structs yourself they need to extend an array, and as i understand it this can be done with a method like such:
so how would i allocate each one? would it be with: [ljass]set integer = Example.allocate[/ljass]; or something like that?
JASS:
struct Example extends array
static integer array r
static integer m = 0
static method allocate takes nothing returns thistype
local thistype this
if r[0]==0 then
set this=m
set m=m+1
else
set this=r[0]
set r[0]=r[r[0]]
endif
return this
endmethod
method deallocate takes nothing returns nothing
set r[this]=r[0]
set r[0]=this
endmethod
endstruct
so how would i allocate each one? would it be with: [ljass]set integer = Example.allocate[/ljass]; or something like that?