"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const constants_1 = require("../core/constants");
const ReadonlyMap_1 = require("../types/ReadonlyMap");
const LEFT = -1;
const UP = -constants_1.LEVEL_GRID_ROW_WIDTH;
const RIGHT = 1;
const DOWN = constants_1.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`).
 */
// We don't use `as const` since we need the map to be indexable by all `DoorSlot`.
// eslint-disable-next-line isaacscript/require-capital-const-assertions
exports.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = {
    // 1
    [isaac_typescript_definitions_1.RoomShape.SHAPE_1x1]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN], // 3
    ]),
    // 2
    [isaac_typescript_definitions_1.RoomShape.IH]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT], // 2
    ]),
    // 3
    [isaac_typescript_definitions_1.RoomShape.IV]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN], // 3
    ]),
    // 4
    [isaac_typescript_definitions_1.RoomShape.SHAPE_1x2]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, DOWN + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, DOWN + RIGHT], // 6
    ]),
    // 5
    [isaac_typescript_definitions_1.RoomShape.IIV]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + DOWN], // 3
    ]),
    // 6
    [isaac_typescript_definitions_1.RoomShape.SHAPE_2x1]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, RIGHT + UP],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, RIGHT + DOWN], // 7
    ]),
    // 7
    [isaac_typescript_definitions_1.RoomShape.IIH]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT + RIGHT], // 2
    ]),
    // 8
    [isaac_typescript_definitions_1.RoomShape.SHAPE_2x2]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, DOWN + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, RIGHT + UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, RIGHT + DOWN + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, RIGHT + DOWN + DOWN], // 7
    ]),
    // 9
    [isaac_typescript_definitions_1.RoomShape.LTL]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, DOWN + LEFT + UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + LEFT + DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, DOWN + LEFT + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, DOWN + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, DOWN + DOWN], // 7
    ]),
    // 10
    [isaac_typescript_definitions_1.RoomShape.LTR]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, DOWN + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, DOWN + RIGHT + UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, DOWN + RIGHT + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, DOWN + RIGHT + DOWN], // 7
    ]),
    // 11
    [isaac_typescript_definitions_1.RoomShape.LBL]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, RIGHT + DOWN + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, RIGHT + UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, RIGHT + DOWN + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, RIGHT + DOWN + DOWN], // 7
    ]),
    // 12
    [isaac_typescript_definitions_1.RoomShape.LBR]: new ReadonlyMap_1.ReadonlyMap([
        [isaac_typescript_definitions_1.DoorSlot.LEFT_0, LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_0, UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_0, RIGHT + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_0, DOWN + DOWN],
        [isaac_typescript_definitions_1.DoorSlot.LEFT_1, DOWN + LEFT],
        [isaac_typescript_definitions_1.DoorSlot.UP_1, RIGHT + UP],
        [isaac_typescript_definitions_1.DoorSlot.RIGHT_1, DOWN + RIGHT],
        [isaac_typescript_definitions_1.DoorSlot.DOWN_1, RIGHT + DOWN], // 7
    ]),
};
