class 'ZoomEventHandler' (zoom_zone)

function ZoomEventHandler:__init(init_info)
    self.name  = init_info.name
    self.level = GetCurrentLevel()
    self.timer = self.level.timer
    self.mouseBlocker = self.level.mouseBlocker
    self.ZoomEventHandler = true
    self.preload_data = true
    self.is_data_load = false
    
    self:InitZone(init_info)
end

function ZoomEventHandler:InitZone(init_info)
    local PREFIX_TRIGER_NAME = 'area_zoom_'
    
    self.zone = CreateZoomZoneEx(self, PREFIX_TRIGER_NAME..init_info.name, init_info.mode, 
                                 init_info.additionOffsetX, init_info.additionOffsetY, init_info.offsetZ)
end

function ZoomEventHandler:OnDefaultOpen()
    if self.OnOpen then
        self:OnOpen()
    end
end

function ZoomEventHandler:OnDefaultClose()
    if self.OnClose then
        self:OnClose()
    end
end

function ZoomEventHandler:DefaultSkipMiniGame()
    if self.SkipMiniGame then
        self:SkipMiniGame()
    end
end

function ZoomEventHandler:OnDefaultUpdate(dt)
    if self.OnUpdate then
        self:OnUpdate(dt)
    end
end

function ZoomEventHandler:OnDefaultAllItemsFound()
    if self.OnAllItemsFound then
        self:OnAllItemsFound()
    end
end

function ZoomEventHandler:OnDefaultObjectMouseEnter(object)
    if self.OnObjectMouseEnter then
        self:OnObjectMouseEnter(object)
    end
end

function ZoomEventHandler:OnDefaultObjectMouseLeave(object)
    if self.OnObjectMouseLeave then
        self:OnObjectMouseLeave(object)
    end
end

function ZoomEventHandler:OnObjectMouseDown(object, key)
    if self.OnScreenObjectMouseDown then
        self:OnScreenObjectMouseDown(object, key)
    end
end

function ZoomEventHandler:OnDefaultObjectMouseDownProcessed(is_wrong_click)
    if self.OnObjectMouseDownProcessed then
        self:OnObjectMouseDownProcessed(is_wrong_click)
    end
end

function ZoomEventHandler:OnDefaultMouseMove(previous_pos, current_pos)
    if self.OnMouseMove then
        self:OnMouseMove(previous_pos, current_pos)
    end
end

function ZoomEventHandler:OnDefaultObjectMouseUp(object)
    if self.OnObjectMouseUp then
        self:OnObjectMouseUp(object)
    end
end

function ZoomEventHandler:OnDefaultObjectFound(object)
    if self.OnObjectFound then
        self:OnObjectFound(object)
    end
end

function ZoomEventHandler:OnDefaultToolFound(tool)
    if self.OnToolFound then
        self:OnToolFound(tool)
    end
end

function ZoomEventHandler:OnDefaultToolApply(tool, object)
    if self.OnToolApply then
        self:OnToolApply(tool, object)
    end
end

function ZoomEventHandler:OnDefaultToolAddToInventory(tool)
    if self.OnToolAddToInventory then
        self:OnToolAddToInventory(tool)
    end
end

function ZoomEventHandler:OnDefaultObjectReachPanel(object)
    if self.OnObjectReachPanel then
        self:OnObjectReachPanel(object)
    end
end

function ZoomEventHandler:OnDefaultButtonPress(title)
    if self.OnButtonPress then
        self:OnButtonPress(title)
    end
end

function ZoomEventHandler:OnDefaultSetTool(tool)
    if self.OnSetTool then
        self:OnSetTool(tool)
    end
end

function ZoomEventHandler:OnDefaultLoaded()
    if self.OnLoaded then
        self:OnLoaded()
    end
end

function ZoomEventHandler:OnDefaultDestroy()
    if self.OnDestroy then
        self:OnDestroy()
    end
end

-- Sound ----------------------------------------------------------------------------------
function ZoomEventHandler:PlaySound(name, cycle)
    self.level:PlaySound(name, cycle or false)
end

function ZoomEventHandler:StopSound(name)
    self.level:StopSound(name)
end

---- Helpers -------------------------------------------------------------------------------
function ZoomEventHandler:IsFirstVisited()
    return self.zone:IsFirstVisited()
end