isaacscript-common 1.2.226 → 1.2.227

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,3 +7,4 @@
7
7
  */
8
8
  export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
9
9
  export declare function getRoomShapeBottomRightPosition(roomShape: RoomShape): Vector;
10
+ export declare function getRoomShapeTopLeftPosition(roomShape: RoomShape): Vector;
@@ -5,6 +5,8 @@ local ____roomShapeToBottomRightPosition = require("objects.roomShapeToBottomRig
5
5
  local ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = ____roomShapeToBottomRightPosition.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION
6
6
  local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
7
7
  local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
8
+ local ____roomShapeToTopLeftPosition = require("objects.roomShapeToTopLeftPosition")
9
+ local ROOM_SHAPE_TO_TOP_LEFT_POSITION = ____roomShapeToTopLeftPosition.ROOM_SHAPE_TO_TOP_LEFT_POSITION
8
10
  function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
9
11
  local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
10
12
  if doorSlotToGridIndexMap == nil then
@@ -15,4 +17,7 @@ end
15
17
  function ____exports.getRoomShapeBottomRightPosition(self, roomShape)
16
18
  return ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION[roomShape]
17
19
  end
20
+ function ____exports.getRoomShapeTopLeftPosition(self, roomShape)
21
+ return ROOM_SHAPE_TO_TOP_LEFT_POSITION[roomShape]
22
+ end
18
23
  return ____exports
@@ -0,0 +1,8 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
4
+ * wall would be at "Vector(-1, -1)".)
5
+ */
6
+ export declare const ROOM_SHAPE_TO_TOP_LEFT_POSITION: {
7
+ readonly [key in RoomShape]: Vector;
8
+ };
@@ -0,0 +1,20 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local NARROW_HORIZONTAL_TOP_LEFT_POSITION = Vector(0, 2)
4
+ local NARROW_VERTICAL_TOP_LEFT_POSITION = Vector(4, 0)
5
+ ____exports.ROOM_SHAPE_TO_TOP_LEFT_POSITION = {
6
+ [RoomShape.ROOMSHAPE_1x1] = Vector.Zero,
7
+ [RoomShape.ROOMSHAPE_IH] = NARROW_HORIZONTAL_TOP_LEFT_POSITION,
8
+ [RoomShape.ROOMSHAPE_IV] = NARROW_VERTICAL_TOP_LEFT_POSITION,
9
+ [RoomShape.ROOMSHAPE_1x2] = Vector.Zero,
10
+ [RoomShape.ROOMSHAPE_IIV] = NARROW_VERTICAL_TOP_LEFT_POSITION,
11
+ [RoomShape.ROOMSHAPE_2x1] = Vector.Zero,
12
+ [RoomShape.ROOMSHAPE_IIH] = NARROW_HORIZONTAL_TOP_LEFT_POSITION,
13
+ [RoomShape.ROOMSHAPE_2x2] = Vector.Zero,
14
+ [RoomShape.ROOMSHAPE_LTL] = Vector(13, 0),
15
+ [RoomShape.ROOMSHAPE_LTR] = Vector.Zero,
16
+ [RoomShape.ROOMSHAPE_LBL] = Vector.Zero,
17
+ [RoomShape.ROOMSHAPE_LBR] = Vector.Zero,
18
+ [RoomShape.NUM_ROOMSHAPES] = Vector.Zero
19
+ }
20
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.226",
3
+ "version": "1.2.227",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",