---@class AddonPrivate
local Private = select(2, ...)

---@class Events
local events = {}
Private.Events = events

function events:InitEvents()
    local addon = Private.Addon
    addon:RegisterEvent("PLAYER_ENTERING_WORLD", function ()
        self:UpdateData()
    end)
    addon:RegisterEvent("ACHIEVEMENT_EARNED", function ()
        self:UpdateData()
    end)
    addon:RegisterEvent("CRITERIA_UPDATE", function ()
        self:UpdateData()
    end)
end

function events:UpdateData()
    Private.UI:QueueUpdate()
end