isaacscript-common 1.2.280 → 1.2.281
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.
|
@@ -44,6 +44,8 @@ export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDe
|
|
|
44
44
|
* Helper function to get the room descriptor for every room on the level in a specific dimension.
|
|
45
45
|
* Uses the `Level.GetRooms` method to accomplish this. Rooms without data are assumed to be
|
|
46
46
|
* non-existent and are not added to the list.
|
|
47
|
+
*
|
|
48
|
+
* @returns A map of room ListIndex to RoomDescriptor.
|
|
47
49
|
*/
|
|
48
50
|
export declare function getRoomsOfDimension(dimension: Dimension): RoomDescriptor[];
|
|
49
51
|
/**
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -3,9 +3,10 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
|
3
3
|
local Set = ____lualib.Set
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
|
+
local Map = ____lualib.Map
|
|
7
|
+
local __TS__Spread = ____lualib.__TS__Spread
|
|
6
8
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
7
9
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
8
|
-
local Map = ____lualib.Map
|
|
9
10
|
local ____exports = {}
|
|
10
11
|
local ____cachedClasses = require("cachedClasses")
|
|
11
12
|
local game = ____cachedClasses.game
|
|
@@ -47,14 +48,14 @@ function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
|
47
48
|
end
|
|
48
49
|
local level = game:GetLevel()
|
|
49
50
|
local roomList = level:GetRooms()
|
|
50
|
-
local
|
|
51
|
+
local roomsMap = __TS__New(Map)
|
|
51
52
|
if includeExtraDimensionalRooms then
|
|
52
53
|
do
|
|
53
54
|
local i = 0
|
|
54
55
|
while i < roomList.Size do
|
|
55
56
|
local roomDescriptor = roomList:Get(i)
|
|
56
57
|
if roomDescriptor ~= nil and roomDescriptor.Data ~= nil then
|
|
57
|
-
|
|
58
|
+
roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
|
|
58
59
|
end
|
|
59
60
|
i = i + 1
|
|
60
61
|
end
|
|
@@ -65,13 +66,13 @@ function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
|
65
66
|
while i <= MAX_ROOM_INDEX do
|
|
66
67
|
local roomDescriptor = level:GetRoomByIdx(i)
|
|
67
68
|
if roomDescriptor.Data ~= nil then
|
|
68
|
-
|
|
69
|
+
roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
|
|
69
70
|
end
|
|
70
71
|
i = i + 1
|
|
71
72
|
end
|
|
72
73
|
end
|
|
73
74
|
end
|
|
74
|
-
return
|
|
75
|
+
return {__TS__Spread(roomsMap:values())}
|
|
75
76
|
end
|
|
76
77
|
function ____exports.inDeathCertificateArea(self)
|
|
77
78
|
local roomStageID = getRoomStageID(nil)
|
|
@@ -136,18 +137,18 @@ function ____exports.getRoomItemPoolType(self)
|
|
|
136
137
|
end
|
|
137
138
|
function ____exports.getRoomsOfDimension(self, dimension)
|
|
138
139
|
local level = game:GetLevel()
|
|
139
|
-
local
|
|
140
|
+
local roomsMap = __TS__New(Map)
|
|
140
141
|
do
|
|
141
142
|
local i = 0
|
|
142
143
|
while i <= MAX_ROOM_INDEX do
|
|
143
144
|
local roomDescriptor = level:GetRoomByIdx(i, dimension)
|
|
144
145
|
if roomDescriptor.Data ~= nil then
|
|
145
|
-
|
|
146
|
+
roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
|
|
146
147
|
end
|
|
147
148
|
i = i + 1
|
|
148
149
|
end
|
|
149
150
|
end
|
|
150
|
-
return
|
|
151
|
+
return {__TS__Spread(roomsMap:values())}
|
|
151
152
|
end
|
|
152
153
|
function ____exports.in2x1Room(self)
|
|
153
154
|
local room = game:GetRoom()
|