local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local Map = ____lualib.Map
local __TS__New = ____lualib.__TS__New
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____stats = require("functions.stats")
local addPlayerStat = ____stats.addPlayerStat
local getDefaultPlayerStat = ____stats.getDefaultPlayerStat
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
--- Easily create custom characters that have base stats different from that of Isaac.
____exports.CharacterStats = __TS__Class()
local CharacterStats = ____exports.CharacterStats
CharacterStats.name = "CharacterStats"
__TS__ClassExtends(CharacterStats, Feature)
function CharacterStats.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.charactersStatMap = __TS__New(Map)
    self.evaluateCache = function(____, player, cacheFlag)
        local character = player:GetPlayerType()
        local statMap = self.charactersStatMap:get(character)
        if statMap == nil then
            return
        end
        local stat = statMap:get(cacheFlag)
        local defaultStat = getDefaultPlayerStat(nil, cacheFlag)
        if stat == nil or defaultStat == nil then
            return
        end
        local delta = stat - defaultStat
        addPlayerStat(nil, player, cacheFlag, delta)
    end
    self.callbacksUsed = {{ModCallback.EVALUATE_CACHE, self.evaluateCache}}
end
function CharacterStats.prototype.registerCharacterStats(self, playerType, statMap)
    self.charactersStatMap:set(playerType, statMap)
end
__TS__DecorateLegacy({Exported}, CharacterStats.prototype, "registerCharacterStats", true)
return ____exports
