// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 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 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 if Base_next[this] != 0 then call dispatch_Base_test_Base_clear(Base_next[this]) endif elseif Base_next[this] != 0 then call dispatch_Base_test_Base_clear(Base_next[this]) endif else if Base_next[this] != 0 then call dispatch_Base_test_Base_clear(Base_next[this]) endif call testSuccess() endif endfunction function dispatch_SubClassA_test_SubClassA_clear takes integer this returns nothing 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 if Base_next[this] != 0 then call dispatch_Base_test_Base_clear(Base_next[this]) endif endfunction function initGlobals takes nothing returns nothing endfunction function new_SubClassA takes nothing returns integer local integer this if Base_firstFree == 0 then if Base_maxIndex < 32768 then set Base_maxIndex = Base_maxIndex + 1 set this = Base_maxIndex set Base_typeId[this] = 2 else call error("Out of memory: Could not create SubClassA.") set this = 0 endif else set Base_firstFree = Base_firstFree - 1 set this = Base_nextFree[Base_firstFree] set Base_typeId[this] = 2 endif return this endfunction function new_SubClassB takes nothing returns integer local integer this if Base_firstFree == 0 then if Base_maxIndex < 32768 then set Base_maxIndex = Base_maxIndex + 1 set this = Base_maxIndex set Base_typeId[this] = 3 else call error("Out of memory: Could not create SubClassB.") set this = 0 endif else set Base_firstFree = Base_firstFree - 1 set this = Base_nextFree[Base_firstFree] set Base_typeId[this] = 3 endif 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