isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
64 lines (50 loc) • 1.44 kB
text/typescript
import { RoomShape } from "isaac-typescript-definitions";
import {
NARROW_CONTENTS_HEIGHT,
NARROW_CONTENTS_WIDTH,
ONE_BY_ONE_CONTENTS_HEIGHT,
ONE_BY_ONE_CONTENTS_WIDTH,
} from "./roomShapeVolumes";
const TWO_BY_TWO_BOUNDS = [
ONE_BY_ONE_CONTENTS_WIDTH * 2,
ONE_BY_ONE_CONTENTS_HEIGHT * 2,
] as const;
/**
* The size of a room shape's contents. This does not include the tiles that the walls are on. L
* rooms use the same bounds as a 2x2 room.
*/
export const ROOM_SHAPE_BOUNDS = {
// 1
[]: [
ONE_BY_ONE_CONTENTS_WIDTH,
ONE_BY_ONE_CONTENTS_HEIGHT,
],
// 2
[]: [ONE_BY_ONE_CONTENTS_WIDTH, NARROW_CONTENTS_HEIGHT],
// 3
[]: [NARROW_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT],
// 4
[]: [
ONE_BY_ONE_CONTENTS_WIDTH,
ONE_BY_ONE_CONTENTS_HEIGHT * 2,
],
// 5
[]: [NARROW_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT * 2],
// 6
[]: [
ONE_BY_ONE_CONTENTS_WIDTH * 2,
ONE_BY_ONE_CONTENTS_HEIGHT,
],
// 7
[]: [ONE_BY_ONE_CONTENTS_WIDTH * 2, NARROW_CONTENTS_HEIGHT],
// 8
[]: TWO_BY_TWO_BOUNDS,
// 9
[]: TWO_BY_TWO_BOUNDS,
// 10
[]: TWO_BY_TWO_BOUNDS,
// 11
[]: TWO_BY_TWO_BOUNDS,
// 12
[]: TWO_BY_TWO_BOUNDS,
} as const satisfies Record<RoomShape, readonly [int, int]>;