local ____lualib = require("lualib_bundle")
local Map = ____lualib.Map
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____cachedEnumValues = require("cachedEnumValues")
local HEALTH_TYPE_VALUES = ____cachedEnumValues.HEALTH_TYPE_VALUES
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____playerHealth = require("functions.playerHealth")
local getPlayerHealthType = ____playerHealth.getPlayerHealthType
local ____playerIndex = require("functions.playerIndex")
local getPlayerIndex = ____playerIndex.getPlayerIndex
local ____shouldFire = require("shouldFire")
local shouldFirePlayer = ____shouldFire.shouldFirePlayer
local ____DefaultMap = require("classes.DefaultMap")
local DefaultMap = ____DefaultMap.DefaultMap
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {run = {playersHealthMap = __TS__New(
    DefaultMap,
    function() return __TS__New(Map) end
)}}
____exports.PostPlayerChangeHealth = __TS__Class()
local PostPlayerChangeHealth = ____exports.PostPlayerChangeHealth
PostPlayerChangeHealth.name = "PostPlayerChangeHealth"
__TS__ClassExtends(PostPlayerChangeHealth, CustomCallback)
function PostPlayerChangeHealth.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = shouldFirePlayer
    self.postPEffectReordered = function(____, player)
        local playerIndex = getPlayerIndex(nil, player, true)
        local playerHealthMap = v.run.playersHealthMap:getAndSetDefault(playerIndex)
        for ____, healthType in ipairs(HEALTH_TYPE_VALUES) do
            local storedHealthValue = playerHealthMap:get(healthType)
            local currentHealthValue = getPlayerHealthType(nil, player, healthType)
            playerHealthMap:set(healthType, currentHealthValue)
            if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
                local difference = currentHealthValue - storedHealthValue
                self:fire(
                    player,
                    healthType,
                    difference,
                    storedHealthValue,
                    currentHealthValue
                )
            end
        end
    end
    self.customCallbacksUsed = {{ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectReordered}}
end
return ____exports
