// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367 globals integer array MyClass_nextFree integer MyClass_firstFree=0 integer MyClass_maxIndex=0 integer array Iterator_nextFree integer Iterator_firstFree=0 integer Iterator_maxIndex=0 endglobals native testSuccess takes nothing returns nothing function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function new_Iterator takes nothing returns integer local integer this if Iterator_firstFree == 0 then if Iterator_maxIndex < 32768 then set Iterator_maxIndex = Iterator_maxIndex + 1 set this = Iterator_maxIndex else call error("Out of memory: Could not create Iterator.") set this = 0 endif else set Iterator_firstFree = Iterator_firstFree - 1 set this = Iterator_nextFree[Iterator_firstFree] endif return this endfunction function MyClass_all takes nothing returns nothing call new_Iterator() loop exitwhen true endloop endfunction function initGlobals takes nothing returns nothing endfunction function new_MyClass takes nothing returns integer local integer this if MyClass_firstFree == 0 then if MyClass_maxIndex < 32768 then set MyClass_maxIndex = MyClass_maxIndex + 1 set this = MyClass_maxIndex else call error("Out of memory: Could not create MyClass.") set this = 0 endif else set MyClass_firstFree = MyClass_firstFree - 1 set this = MyClass_nextFree[MyClass_firstFree] endif return this endfunction function main takes nothing returns nothing call initGlobals() call new_MyClass() call new_MyClass() call MyClass_all() call testSuccess() endfunction function config takes nothing returns nothing endfunction