local hbHealsIn={}
local HealBot_TitanID=false
local HealBot_TitanCalled=false
local xGUID=nil

function HealBot_IncHeals_retHealsIn(hbGUID)
    return hbHealsIn[hbGUID] or 0
end

function HealBot_IncHeals_updHealsIn(unit)
    if HealBot_Unit_Button[unit] then
        xGUID=HealBot_UnitGUID(unit)
        if xGUID then 
            hbHealsIn[xGUID]=UnitGetIncomingHeals(unit) 
            HealBot_RecalcHeals(xGUID)
        elseif hbHealsIn[xGUID] then
            hbHealsIn[xGUID]=nil
            HealBot_Action_ResetUnitStatus(unit)
        end
    end
end

function HealBot_IncHeals_ClearLocalArr(hbGUID)
    if hbHealsIn[hbGUID] then hbHealsIn[hbGUID]=nil end
end

function HealBot_IncHeals_ClearAll()
    for xGUID,_ in pairs(hbHealsIn) do
        hbHealsIn[xGUID]=nil
    end
end

function HealBot_Titan_Installed(hbTitanId)
    HealBot_TitanCalled=hbTitanId
    HealBot_TitanHealBot_Toggle()
end

function HealBot_Titan_Toggle()
    if HealBot_Config.UpdateTitan==1 then
        HealBot_Config.UpdateTitan=0
        HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_TITANOFF)
    else
        HealBot_Config.UpdateTitan=1
        HealBot_AddChat(HEALBOT_CHAT_ADDONID..HEALBOT_CHAT_TITANON)
    end
    HealBot_TitanHealBot_Toggle()
end

function HealBot_TitanHealBot_Toggle()
    if HealBot_TitanCalled then
        if HealBot_Config.UpdateTitan==1 then
            HealBot_TitanID=HealBot_TitanCalled
        else
            HealBot_TitanID=false
        end
    end
end



