isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
26 lines (23 loc) • 1.13 kB
text/typescript
import { RoomShape } from "isaac-typescript-definitions";
import { VectorZero } from "../core/constants";
import { newReadonlyVector } from "../functions/readOnly";
const NARROW_HORIZONTAL_TOP_LEFT_POSITION = newReadonlyVector(0, 2);
const NARROW_VERTICAL_TOP_LEFT_POSITION = newReadonlyVector(4, 0);
/**
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
* wall would be at "Vector(-1, -1)".)
*/
export const ROOM_SHAPE_TO_TOP_LEFT_POSITION = {
[]: VectorZero, // 1
[]: NARROW_HORIZONTAL_TOP_LEFT_POSITION, // 2
[]: NARROW_VERTICAL_TOP_LEFT_POSITION, // 3
[]: VectorZero, // 4
[]: NARROW_VERTICAL_TOP_LEFT_POSITION, // 5
[]: VectorZero, // 6
[]: NARROW_HORIZONTAL_TOP_LEFT_POSITION, // 7
[]: VectorZero, // 8
[]: newReadonlyVector(13, 0), // 9
[]: VectorZero, // 10
[]: VectorZero, // 11
[]: VectorZero, // 12
} as const satisfies Record<RoomShape, Readonly<Vector>>;