// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367 globals integer array Base_nextFree integer Base_firstFree=0 integer Base_maxIndex=0 integer array Base_typeId integer array Base_next endglobals native testSuccess takes nothing returns nothing function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function dispatch_Base_test_Base_clear takes integer this returns nothing local integer this_1 local integer this_2 local integer this_3 local integer this_4 local integer this_5 if Base_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Base.clear") else call error("Called Base.clear on invalid object.") endif endif if Base_typeId[this] <= 2 then if Base_typeId[this] <= 1 then set this_1 = this if Base_next[this_1] != 0 then call dispatch_Base_test_Base_clear(Base_next[this_1]) endif else set this_2 = this set this_3 = this_2 if Base_next[this_3] != 0 then call dispatch_Base_test_Base_clear(Base_next[this_3]) endif endif else set this_4 = this set this_5 = this_4 if Base_next[this_5] != 0 then call dispatch_Base_test_Base_clear(Base_next[this_5]) endif call testSuccess() endif endfunction function dispatch_SubClassA_test_SubClassA_clear takes integer this returns nothing local integer this_1 local integer this_2 if Base_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling SubClassA.clear") else call error("Called SubClassA.clear on invalid object.") endif endif set this_1 = this set this_2 = this_1 if Base_next[this_2] != 0 then call dispatch_Base_test_Base_clear(Base_next[this_2]) endif endfunction function initGlobals takes nothing returns nothing endfunction function new_SubClassA takes nothing returns integer local integer this local integer this_1 if Base_firstFree == 0 then if Base_maxIndex < 32768 then set Base_maxIndex = Base_maxIndex + 1 set this_1 = Base_maxIndex set Base_typeId[this_1] = 2 else call error("Out of memory: Could not create SubClassA.") set this_1 = 0 endif else set Base_firstFree = Base_firstFree - 1 set this_1 = Base_nextFree[Base_firstFree] set Base_typeId[this_1] = 2 endif set this = this_1 return this endfunction function new_SubClassB takes nothing returns integer local integer this local integer this_1 if Base_firstFree == 0 then if Base_maxIndex < 32768 then set Base_maxIndex = Base_maxIndex + 1 set this_1 = Base_maxIndex set Base_typeId[this_1] = 3 else call error("Out of memory: Could not create SubClassB.") set this_1 = 0 endif else set Base_firstFree = Base_firstFree - 1 set this_1 = Base_nextFree[Base_firstFree] set Base_typeId[this_1] = 3 endif set this = this_1 return this endfunction function main takes nothing returns nothing local integer suba local integer subb call initGlobals() set suba = new_SubClassA() set subb = new_SubClassB() set Base_next[suba] = subb call dispatch_SubClassA_test_SubClassA_clear(suba) endfunction function config takes nothing returns nothing endfunction