local hbHealsIn={}
local hbAbsorbs={}
local xGUID=nil
local xUnit=nil
local _

function HealBot_IncHeals_retHealsIn(hbGUID)
    local x=hbHealsIn[hbGUID] or 0
    local y=hbAbsorbs[hbGUID] or 0
    return x, y
end

function HealBot_IncHeals_updHealsIn(unit)
    xGUID=HealBot_UnitGUID(unit)
    if xGUID and HealBot_UnitData[xGUID] then
        HealBot_IncHeals_HealsInUpdate(xGUID, unit)
    end
end

function HealBot_IncHeals_HealsInUpdate(hbGUID, unit)

    xUnit=unit or HealBot_UnitData[hbGUID]["UNIT"]
    hbHealsIn[hbGUID]=UnitGetIncomingHeals(xUnit)
    hbAbsorbs[hbGUID]=UnitGetTotalAbsorbs(xUnit)
    HealBot_RecalcHeals(hbGUID, unit)

    local x=hbHealsIn[hbGUID] or 0
    local y=hbAbsorbs[hbGUID] or 0
    if (x+y)==0 then
        HealBot_setHealsAbsorb(hbGUID, nil)
    else
        HealBot_setHealsAbsorb(hbGUID, true)
    end
end

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

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




