:NAME gear_counter

:CONFIG int32 initial_num_noise_maker
:CONFIG int32 initial_num_zip
:CONFIG int32 initial_num_clone
:CONFIG int32 initial_num_key


:VAR int32 cur_num_noise_maker
:VAR int32 cur_num_zip
:VAR int32 cur_num_clone
:VAR int32 cur_num_key


-- --------------- globals ---------------


-- --------------- initialization ---------------

function config_initialize(c)
--	print("CB: gear_counter config_initialize")
	c.initial_num_noise_maker = 0
	c.initial_num_zip = 0
	c.initial_num_clone = 0
	c.initial_num_key = 0	
end

function param_initialize(p)

end

function var_initialize(v)
--	print("CB: gear_counter var_initialize")

end


-- --------------- component ---------------


function attach(object)
--	print("CB: gear_counter attach")
	if(config == nil) then
--		print("CB: Nil config in gear_counter")
		var.cur_num_noise_maker = 20000
		var.cur_num_zip = 20000
		var.cur_num_clone = 20000		
		var.cur_num_key = 20000
	else
--		print("CB: gear_counter found")
		var.cur_num_noise_maker = config.initial_num_noise_maker
		var.cur_num_zip = config.initial_num_zip
		var.cur_num_clone = config.initial_num_clone
		var.cur_num_key = config.initial_num_key
	end
end

function update(object)
end

component_register(attach, update, nil, nil)
