// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 globals integer array F_nextFree integer F_firstFree=0 integer F_maxIndex=0 integer array F_typeId integer array Cell_nextFree integer Cell_firstFree=0 integer Cell_maxIndex=0 integer array Cell_typeId integer array Cell_elem endglobals native println takes string s returns nothing 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 dispatch_F_test_F_apply takes integer this, integer a returns integer if F_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling F.apply") else call error("Called F.apply on invalid object.") endif endif return R2I(a * 10. * 1000.) endfunction function new_Cell takes integer t returns integer local integer this if Cell_firstFree == 0 then if Cell_maxIndex < 32768 then set Cell_maxIndex = Cell_maxIndex + 1 set this = Cell_maxIndex set Cell_typeId[this] = 1 else call error("Out of memory: Could not create Cell.") set this = 0 endif else set Cell_firstFree = Cell_firstFree - 1 set this = Cell_nextFree[Cell_firstFree] set Cell_typeId[this] = 1 endif set Cell_elem[this] = t return this endfunction function init_test takes nothing returns nothing local integer a = new_Cell(5) local integer this local real this_1 if F_firstFree == 0 then if F_maxIndex < 32768 then set F_maxIndex = F_maxIndex + 1 set this = F_maxIndex set F_typeId[this] = 3 else call error("Out of memory: Could not create F_map_test.") set this = 0 endif else set F_firstFree = F_firstFree - 1 set this = F_nextFree[F_firstFree] set F_typeId[this] = 3 endif if Cell_typeId[a] == 0 then if a == 0 then call error("Nullpointer exception when calling Cell.map") else call error("Called Cell.map on invalid object.") endif endif set a = new_Cell(dispatch_F_test_F_apply(this, Cell_elem[a])) if Cell_typeId[a] == 0 then if a == 0 then call error("Nullpointer exception when calling Cell.get") else call error("Called Cell.get on invalid object.") endif endif set this_1 = Cell_elem[a] / 1000. if this_1 == 50. then call testSuccess() else call println(R2S(this_1)) endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction