isaacscript-common 1.0.554 → 1.0.555
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.
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare function closeAllDoors(): void;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to get all of the doors in the room. By default, it will return every door. You
|
|
5
|
+
* can optionally specify one or more room types to return only the doors that match the specified
|
|
6
|
+
* room types.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDoors(...roomTypes: RoomType[]): GridEntityDoor[];
|
|
4
9
|
export declare function getAngelRoomDoor(): GridEntityDoor | undefined;
|
|
5
10
|
export declare function getDevilRoomDoor(): GridEntityDoor | undefined;
|
|
6
11
|
/**
|
package/dist/functions/doors.lua
CHANGED
|
@@ -3,9 +3,11 @@ require("lualib_bundle");
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____constants = require("constants")
|
|
5
5
|
local MAX_NUM_DOORS = ____constants.MAX_NUM_DOORS
|
|
6
|
-
function ____exports.getDoors(self,
|
|
6
|
+
function ____exports.getDoors(self, ...)
|
|
7
|
+
local roomTypes = {...}
|
|
7
8
|
local game = Game()
|
|
8
9
|
local room = game:GetRoom()
|
|
10
|
+
local roomTypesSet = __TS__New(Set, roomTypes)
|
|
9
11
|
local doors = {}
|
|
10
12
|
do
|
|
11
13
|
local i = 0
|
|
@@ -15,9 +17,9 @@ function ____exports.getDoors(self, roomType)
|
|
|
15
17
|
if door == nil then
|
|
16
18
|
goto __continue5
|
|
17
19
|
end
|
|
18
|
-
if
|
|
20
|
+
if #roomTypes == 0 then
|
|
19
21
|
__TS__ArrayPush(doors, door)
|
|
20
|
-
elseif
|
|
22
|
+
elseif roomTypesSet:has(door.TargetRoomType) then
|
|
21
23
|
__TS__ArrayPush(doors, door)
|
|
22
24
|
end
|
|
23
25
|
end
|