// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer array Pair_nextFree integer Pair_firstFree=0 integer Pair_maxIndex=0 integer array Pair_a endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing set Pair_firstFree = 0 set Pair_maxIndex = 0 endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function alloc_OtherPair takes nothing returns integer local integer this if Pair_firstFree == 0 then if Pair_maxIndex < 32768 then set Pair_maxIndex = Pair_maxIndex + 1 set this = Pair_maxIndex else call error("Out of memory: Could not create OtherPair.") set this = 0 endif else set Pair_firstFree = Pair_firstFree - 1 set this = Pair_nextFree[Pair_firstFree] endif return this endfunction function OtherPair_init takes integer this returns nothing endfunction function Pair_init takes integer this returns nothing endfunction function construct_Pair takes integer this, integer a, integer b returns nothing call Pair_init(this) set Pair_a[this] = a endfunction function construct_OtherPair takes integer this, integer a, integer b returns nothing call construct_Pair(this, a, b) call OtherPair_init(this) endfunction function new_OtherPair takes integer a, integer b returns integer local integer this = alloc_OtherPair() call construct_OtherPair(this, a, b) return this endfunction function init_test takes nothing returns nothing if Pair_a[new_OtherPair(2, 3)] == 2 then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction