local druid = require("druid.druid")


local function click_callback(self)
	print("Just tap callback")
end


function init(self)
	self.druid_whitelist = druid.new(self)

	-- Whitelist
	self.button_wl_left = self.druid_whitelist:new_button("button_whitelist_1/button", click_callback)
	self.button_wl_middle = self.druid_whitelist:new_button("button_whitelist_2/button", click_callback)
	self.button_wl_right = self.druid_whitelist:new_button("button_whitelist_3/button", click_callback)
	self.druid_whitelist:set_whitelist(self.button_wl_left)


	self.druid_blacklist = druid.new(self)

	-- Blacklist
	self.button_bl_left = self.druid_blacklist:new_button("button_blacklist_1/button", click_callback)
	self.button_bl_middle = self.druid_blacklist:new_button("button_blacklist_2/button", click_callback)
	self.button_bl_right = self.druid_blacklist:new_button("button_blacklist_3/button", click_callback)
	self.druid_blacklist:set_blacklist(self.button_bl_left)


	self.druid_wb = druid.new(self)

	-- Blacklist and Whitelist
	self.button_wb_left = self.druid_wb:new_button("button_wb_1/button", click_callback)
	self.button_wb_middle = self.druid_wb:new_button("button_wb_2/button", click_callback)
	self.button_wb_right = self.druid_wb:new_button("button_wb_3/button", click_callback)
	self.druid_wb:set_whitelist(self.button_wb_left)
	self.druid_wb:set_blacklist(self.button_wb_left)
end


function final(self)
	self.druid_whitelist:final()
	self.druid_blacklist:final()
	self.druid_wb:final()
end


function update(self, dt)
	self.druid_whitelist:update(dt)
	self.druid_blacklist:update(dt)
	self.druid_wb:update(dt)
end


function on_message(self, message_id, message, sender)
	self.druid_whitelist:on_message(message_id, message, sender)
	self.druid_blacklist:on_message(message_id, message, sender)
	self.druid_wb:on_message(message_id, message, sender)
end


function on_input(self, action_id, action)
	local result_1 = self.druid_whitelist:on_input(action_id, action)
	local result_2 = self.druid_blacklist:on_input(action_id, action)
	local result_3 = self.druid_wb:on_input(action_id, action)

	return result_1 or result_2 or result_3
end
