local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
local ____directionNames = require("objects.directionNames")
local DIRECTION_NAMES = ____directionNames.DIRECTION_NAMES
local ____directionToDegrees = require("objects.directionToDegrees")
local DIRECTION_TO_DEGREES = ____directionToDegrees.DIRECTION_TO_DEGREES
local ____directionToMoveAction = require("objects.directionToMoveAction")
local DIRECTION_TO_MOVE_ACTION = ____directionToMoveAction.DIRECTION_TO_MOVE_ACTION
local ____directionToShootAction = require("objects.directionToShootAction")
local DIRECTION_TO_SHOOT_ACTION = ____directionToShootAction.DIRECTION_TO_SHOOT_ACTION
local ____directionToVector = require("objects.directionToVector")
local DIRECTION_TO_VECTOR = ____directionToVector.DIRECTION_TO_VECTOR
--- Helper function to convert the degrees of an angle to the `Direction` enum.
-- 
-- Note that this function considers 0 degrees to be pointing to the right, which is unusual because
-- 0 normally corresponds to up. (This corresponds to how the `Vector.GetAngleDegrees` method
-- works.)
function ____exports.angleToDirection(self, angleDegrees)
    local positiveDegrees = angleDegrees
    while positiveDegrees < 0 do
        positiveDegrees = positiveDegrees + 360
    end
    local normalizedDegrees = positiveDegrees % 360
    if normalizedDegrees < 45 then
        return Direction.RIGHT
    end
    if normalizedDegrees < 135 then
        return Direction.DOWN
    end
    if normalizedDegrees < 225 then
        return Direction.LEFT
    end
    if normalizedDegrees < 315 then
        return Direction.UP
    end
    return Direction.RIGHT
end
--- Helper function to convert a direction to degrees. For example, `Direction.LEFT` (0) would return
-- 180 and `Direction.RIGHT` (2) would return 0. (This corresponds to how the
-- `Vector.GetAngleDegrees` method works.)
function ____exports.directionToDegrees(self, direction)
    return DIRECTION_TO_DEGREES[direction]
end
--- Helper function to convert a direction to a shoot `ButtonAction`. For example, `Direction.LEFT`
-- (0) would return `ButtonAction.LEFT` (0).
function ____exports.directionToMoveAction(self, direction)
    return DIRECTION_TO_MOVE_ACTION[direction]
end
--- Helper function to convert a direction to a shoot `ButtonAction`. For example, `Direction.LEFT`
-- (0) would return `ButtonAction.SHOOT_LEFT` (4).
function ____exports.directionToShootAction(self, direction)
    return DIRECTION_TO_SHOOT_ACTION[direction]
end
--- Helper function to convert a direction to a `Vector`. For example, `Direction.LEFT` (0) would
-- convert to `Vector(-1, 0).
function ____exports.directionToVector(self, direction)
    return DIRECTION_TO_VECTOR[direction]
end
--- Helper function to get the lowercase name of a direction. For example, `Direction.LEFT` (0) would
-- return "left".
function ____exports.getDirectionName(self, direction)
    return DIRECTION_NAMES[direction]
end
return ____exports
