local ____lualib = require("lualib_bundle")
local __TS__New = ____lualib.__TS__New
local Map = ____lualib.Map
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local KnifeVariant = ____isaac_2Dtypescript_2Ddefinitions.KnifeVariant
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____ReadonlySet = require("types.ReadonlySet")
local ReadonlySet = ____ReadonlySet.ReadonlySet
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local BONE_SWING_ANIMATIONS = __TS__New(ReadonlySet, {"Swing", "Swing2", "Spin"})
local v = {room = {boneClubAnimations = __TS__New(Map)}}
____exports.PostBoneSwing = __TS__Class()
local PostBoneSwing = ____exports.PostBoneSwing
PostBoneSwing.name = "PostBoneSwing"
__TS__ClassExtends(PostBoneSwing, CustomCallback)
function PostBoneSwing.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.postKnifeRender = function(____, knife)
        if knife.Variant == KnifeVariant.BONE_CLUB then
            self:postKnifeRenderBoneClub(knife)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_KNIFE_RENDER, self.postKnifeRender}}
end
function PostBoneSwing.prototype.postKnifeRenderBoneClub(self, knife)
    local sprite = knife:GetSprite()
    local animation = sprite:GetAnimation()
    local ptrHash = GetPtrHash(knife)
    local animationOnLastFrame = v.room.boneClubAnimations:get(ptrHash)
    v.room.boneClubAnimations:set(ptrHash, animation)
    if animationOnLastFrame ~= nil and animation ~= animationOnLastFrame then
        self:boneClubAnimationChanged(knife, animation)
    end
end
function PostBoneSwing.prototype.boneClubAnimationChanged(self, knife, animation)
    if BONE_SWING_ANIMATIONS:has(animation) then
        self:fire(knife)
    end
end
return ____exports
