// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer Test_x=0 integer array VoidFunction_nextFree integer VoidFunction_firstFree=0 integer VoidFunction_maxIndex=0 integer array VoidFunction_typeId endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function alloc_VoidFunction_Test takes nothing returns integer local integer this if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set this = VoidFunction_maxIndex set VoidFunction_typeId[this] = 2 else call error("Out of memory: Could not create VoidFunction_Test.") set this = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set this = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[this] = 2 endif return this endfunction function alloc_VoidFunction_Test_2 takes nothing returns integer local integer this if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set this = VoidFunction_maxIndex set VoidFunction_typeId[this] = 3 else call error("Out of memory: Could not create VoidFunction_Test.") set this = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set this = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[this] = 3 endif return this endfunction function VoidFunction_init takes integer this returns nothing endfunction function construct_VoidFunction takes integer this returns nothing call VoidFunction_init(this) endfunction function cyc_foo takes integer funcChoice, integer i, integer j returns nothing if funcChoice == 0 then set Test_x = Test_x + 1 set funcChoice = alloc_VoidFunction_Test() call construct_VoidFunction(funcChoice) call cyc_foo(3, funcChoice, i) elseif funcChoice == 1 then call cyc_foo(0, j - 1, 0) elseif funcChoice == 2 then call cyc_foo(4, j - 1, 0) elseif funcChoice == 3 then if VoidFunction_typeId[i] == 0 then if i == 0 then call error("Nullpointer exception when calling VoidFunction.call") else call error("Called VoidFunction.call on invalid object.") endif endif if VoidFunction_typeId[i] <= 2 then call cyc_foo(2, i, j) else call cyc_foo(1, i, j) endif elseif funcChoice == 4 then set Test_x = Test_x + 1 set funcChoice = alloc_VoidFunction_Test_2() call construct_VoidFunction(funcChoice) if i > 0 then call cyc_foo(3, funcChoice, i) endif endif endfunction function init_Test takes nothing returns nothing call cyc_foo(4, 10, 0) if Test_x == 11 then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_Test() endfunction function config takes nothing returns nothing endfunction