// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367
globals
integer array Test_nextFree
integer Test_firstFree=0
integer Test_maxIndex=0
integer array Test_typeId
endglobals
function initGlobals takes nothing returns nothing
endfunction

function error takes string msg returns nothing
	call BJDebugMsg(msg + "\n" + "")
endfunction

function new_Test takes nothing returns integer
	local integer this
	if Test_firstFree == 0 then
		if Test_maxIndex < 32768 then
			set Test_maxIndex = Test_maxIndex + 1
			set this = Test_maxIndex
			set Test_typeId[this] = 1
		else
			call error("Out of memory: Could not create Test.")
			set this = 0
		endif
	else
		set Test_firstFree = Test_firstFree - 1
		set this = Test_nextFree[Test_firstFree]
		set Test_typeId[this] = 1
	endif
	return this
endfunction

function init_test takes nothing returns nothing
	local integer t = new_Test()
	if Test_typeId[t] == 0 then
		if t == 0 then
			call error("Nullpointer exception when calling Test.colorize")
		else
			call error("Called Test.colorize on invalid object.")
		endif
	endif
endfunction

function main takes nothing returns nothing
	call initGlobals()
	call init_test()
endfunction

function config takes nothing returns nothing
endfunction