local ____lualib = require("lualib_bundle")
local __TS__New = ____lualib.__TS__New
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
local ____constants = require("core.constants")
local LEVEL_GRID_ROW_WIDTH = ____constants.LEVEL_GRID_ROW_WIDTH
local ____ReadonlyMap = require("types.ReadonlyMap")
local ReadonlyMap = ____ReadonlyMap.ReadonlyMap
local LEFT = -1
local UP = -LEVEL_GRID_ROW_WIDTH
local RIGHT = 1
local DOWN = LEVEL_GRID_ROW_WIDTH
--- Deltas are considered to be from the safe grid index of the room (i.e. the top left corner, or
-- top right corner in the case of `RoomShape.LTL`).
____exports.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = {
    [RoomShape.SHAPE_1x1] = __TS__New(ReadonlyMap, {{DoorSlot.LEFT_0, LEFT}, {DoorSlot.UP_0, UP}, {DoorSlot.RIGHT_0, RIGHT}, {DoorSlot.DOWN_0, DOWN}}),
    [RoomShape.IH] = __TS__New(ReadonlyMap, {{DoorSlot.LEFT_0, LEFT}, {DoorSlot.RIGHT_0, RIGHT}}),
    [RoomShape.IV] = __TS__New(ReadonlyMap, {{DoorSlot.UP_0, UP}, {DoorSlot.DOWN_0, DOWN}}),
    [RoomShape.SHAPE_1x2] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT},
        {DoorSlot.DOWN_0, DOWN + DOWN},
        {DoorSlot.LEFT_1, DOWN + LEFT},
        {DoorSlot.RIGHT_1, DOWN + RIGHT}
    }),
    [RoomShape.IIV] = __TS__New(ReadonlyMap, {{DoorSlot.UP_0, UP}, {DoorSlot.DOWN_0, DOWN + DOWN}}),
    [RoomShape.SHAPE_2x1] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT + RIGHT},
        {DoorSlot.DOWN_0, DOWN},
        {DoorSlot.UP_1, RIGHT + UP},
        {DoorSlot.DOWN_1, RIGHT + DOWN}
    }),
    [RoomShape.IIH] = __TS__New(ReadonlyMap, {{DoorSlot.LEFT_0, LEFT}, {DoorSlot.RIGHT_0, RIGHT + RIGHT}}),
    [RoomShape.SHAPE_2x2] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT + RIGHT},
        {DoorSlot.DOWN_0, DOWN + DOWN},
        {DoorSlot.LEFT_1, DOWN + LEFT},
        {DoorSlot.UP_1, RIGHT + UP},
        {DoorSlot.RIGHT_1, RIGHT + DOWN + RIGHT},
        {DoorSlot.DOWN_1, RIGHT + DOWN + DOWN}
    }),
    [RoomShape.LTL] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, DOWN + LEFT + UP},
        {DoorSlot.RIGHT_0, RIGHT},
        {DoorSlot.DOWN_0, DOWN + LEFT + DOWN},
        {DoorSlot.LEFT_1, DOWN + LEFT + LEFT},
        {DoorSlot.UP_1, UP},
        {DoorSlot.RIGHT_1, DOWN + RIGHT},
        {DoorSlot.DOWN_1, DOWN + DOWN}
    }),
    [RoomShape.LTR] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT},
        {DoorSlot.DOWN_0, DOWN + DOWN},
        {DoorSlot.LEFT_1, DOWN + LEFT},
        {DoorSlot.UP_1, DOWN + RIGHT + UP},
        {DoorSlot.RIGHT_1, DOWN + RIGHT + RIGHT},
        {DoorSlot.DOWN_1, DOWN + RIGHT + DOWN}
    }),
    [RoomShape.LBL] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT + RIGHT},
        {DoorSlot.DOWN_0, DOWN},
        {DoorSlot.LEFT_1, RIGHT + DOWN + LEFT},
        {DoorSlot.UP_1, RIGHT + UP},
        {DoorSlot.RIGHT_1, RIGHT + DOWN + RIGHT},
        {DoorSlot.DOWN_1, RIGHT + DOWN + DOWN}
    }),
    [RoomShape.LBR] = __TS__New(ReadonlyMap, {
        {DoorSlot.LEFT_0, LEFT},
        {DoorSlot.UP_0, UP},
        {DoorSlot.RIGHT_0, RIGHT + RIGHT},
        {DoorSlot.DOWN_0, DOWN + DOWN},
        {DoorSlot.LEFT_1, DOWN + LEFT},
        {DoorSlot.UP_1, RIGHT + UP},
        {DoorSlot.RIGHT_1, DOWN + RIGHT},
        {DoorSlot.DOWN_1, RIGHT + DOWN}
    })
}
return ____exports
