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 __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 ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____collectibles = require("functions.collectibles")
local isActiveCollectible = ____collectibles.isActiveCollectible
local ____playerDataStructures = require("functions.playerDataStructures")
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
local mapHasPlayer = ____playerDataStructures.mapHasPlayer
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
local ____playerHealth = require("functions.playerHealth")
local getPlayerHealth = ____playerHealth.getPlayerHealth
local ____players = require("functions.players")
local isEden = ____players.isEden
local ____stats = require("functions.stats")
local getPlayerStats = ____stats.getPlayerStats
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {run = {
    edenActiveCollectibles = __TS__New(Map),
    edenPassiveCollectibles = __TS__New(Map),
    edenPlayerStats = __TS__New(Map),
    edenPlayerHealth = __TS__New(Map)
}}
____exports.EdenStartingStatsHealth = __TS__Class()
local EdenStartingStatsHealth = ____exports.EdenStartingStatsHealth
EdenStartingStatsHealth.name = "EdenStartingStatsHealth"
__TS__ClassExtends(EdenStartingStatsHealth, Feature)
function EdenStartingStatsHealth.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.postPlayerInit = function(____, player)
        if not isEden(nil, player) then
            return
        end
        self:getEdenStats(player)
        self:getEdenHealth(player)
    end
    self.postPlayerCollectibleAdded = function(____, player, collectibleType)
        if not isEden(nil, player) then
            return
        end
        local map = isActiveCollectible(nil, collectibleType) and v.run.edenActiveCollectibles or v.run.edenPassiveCollectibles
        if not mapHasPlayer(nil, map, player) then
            mapSetPlayer(nil, map, player, collectibleType)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
    self.customCallbacksUsed = {{ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED, self.postPlayerCollectibleAdded}}
end
function EdenStartingStatsHealth.prototype.getEdenStats(self, player)
    local existingStatMap = mapGetPlayer(nil, v.run.edenPlayerStats, player)
    if existingStatMap ~= nil then
        return
    end
    local playerStats = getPlayerStats(nil, player)
    mapSetPlayer(nil, v.run.edenPlayerStats, player, playerStats)
end
function EdenStartingStatsHealth.prototype.getEdenHealth(self, player)
    local existingHealthMap = mapGetPlayer(nil, v.run.edenPlayerHealth, player)
    if existingHealthMap ~= nil then
        return
    end
    local playerHealth = getPlayerHealth(nil, player)
    mapSetPlayer(nil, v.run.edenPlayerHealth, player, playerHealth)
end
function EdenStartingStatsHealth.prototype.getEdenStartingActiveCollectible(self, player)
    return mapGetPlayer(nil, v.run.edenActiveCollectibles, player)
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingActiveCollectible", true)
function EdenStartingStatsHealth.prototype.getEdenStartingCollectibles(self, player)
    local collectibleTypes = {}
    local activeCollectibleType = mapGetPlayer(nil, v.run.edenActiveCollectibles, player)
    if activeCollectibleType ~= nil then
        collectibleTypes[#collectibleTypes + 1] = activeCollectibleType
    end
    local passiveCollectibleType = mapGetPlayer(nil, v.run.edenPassiveCollectibles, player)
    if passiveCollectibleType ~= nil then
        collectibleTypes[#collectibleTypes + 1] = passiveCollectibleType
    end
    return collectibleTypes
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingCollectibles", true)
function EdenStartingStatsHealth.prototype.getEdenStartingHealth(self, player)
    return mapGetPlayer(nil, v.run.edenPlayerHealth, player)
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingHealth", true)
function EdenStartingStatsHealth.prototype.getEdenStartingPassiveCollectible(self, player)
    return mapGetPlayer(nil, v.run.edenPassiveCollectibles, player)
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingPassiveCollectible", true)
function EdenStartingStatsHealth.prototype.getEdenStartingStat(self, player, playerStat)
    local playerStats = mapGetPlayer(nil, v.run.edenPlayerStats, player)
    if playerStats == nil then
        return nil
    end
    return playerStats[playerStat]
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStat", true)
function EdenStartingStatsHealth.prototype.getEdenStartingStats(self, player)
    return mapGetPlayer(nil, v.run.edenPlayerStats, player)
end
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStats", true)
return ____exports
