isaacscript-common 1.2.28 → 1.2.29

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.
@@ -43,8 +43,11 @@ export declare function getRoomDescriptor(roomGridIndex?: int): RoomDescriptor;
43
43
  * specified room type.
44
44
  *
45
45
  * This function only searches through rooms in the current dimension.
46
+ *
47
+ * This function is variadic, meaning that you can specify N arguments to get the combined grid
48
+ * indexes for N room types.
46
49
  */
47
- export declare function getRoomGridIndexesForType(roomType: RoomType): int[];
50
+ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[];
48
51
  /**
49
52
  * Helper function to get the item pool type for the current room. For example, this returns
50
53
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
@@ -1,6 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
3
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
4
+ local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
4
5
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
5
6
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
6
7
  local Set = ____lualib.Set
@@ -132,11 +133,12 @@ function ____exports.getRoomDataType(self, roomGridIndex)
132
133
  local roomData = ____exports.getRoomData(nil, roomGridIndex)
133
134
  return roomData == nil and -1 or roomData.Type
134
135
  end
135
- function ____exports.getRoomGridIndexesForType(self, roomType)
136
+ function ____exports.getRoomGridIndexesForType(self, ...)
137
+ local roomTypes = {...}
136
138
  local rooms = ____exports.getRooms(nil)
137
139
  local matchingRooms = __TS__ArrayFilter(
138
140
  rooms,
139
- function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomDescriptor.Data.Type == roomType end
141
+ function(____, roomDescriptor) return roomDescriptor.Data ~= nil and __TS__ArrayIncludes(roomTypes, roomDescriptor.Data.Type) end
140
142
  )
141
143
  return __TS__ArrayMap(
142
144
  matchingRooms,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",