Room History
Classes
Section titled “Classes”RoomHistory
Section titled “RoomHistory”Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:23
Extends
Section titled “Extends”Feature
Methods
Section titled “Methods”deleteLastRoomDescription()
Section titled “deleteLastRoomDescription()”deleteLastRoomDescription():
void
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:79
Helper function to manually delete the last room description from the internal array. This is useful if a mod needs to send the player to a room temporarily and the room should not count as the player having traveled to that room.
Returns
Section titled “Returns”void
getNumRoomsEntered()
Section titled “getNumRoomsEntered()”getNumRoomsEntered():
int
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:92
Helper function to get the total number of rooms that the player has entered thus far on the run. (Re-entering the same room will increment the number returned.)
In order to use this function, you must upgrade your mod with ISCFeature.ROOM_HISTORY.
Returns
Section titled “Returns”int
getRoomHistory()
Section titled “getRoomHistory()”getRoomHistory(): readonly
Readonly<RoomDescription>[]
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:105
Helper function to get information about all of the rooms that a player has visited thus far on this run.
In order to use this function, you must upgrade your mod with ISCFeature.ROOM_HISTORY.
Returns
Section titled “Returns”readonly Readonly<RoomDescription>[]
getPreviousRoomDescription()
Section titled “getPreviousRoomDescription()”getPreviousRoomDescription():
Readonly<RoomDescription>
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:120
Helper function to get information about the room that was previously visited.
In the special case of only one room having been visited thus far (i.e. the starting room of the run), the starting room will be returned.
In order to use this function, you must upgrade your mod with ISCFeature.ROOM_HISTORY.
Returns
Section titled “Returns”Readonly<RoomDescription>
getLatestRoomDescription()
Section titled “getLatestRoomDescription()”getLatestRoomDescription():
Readonly<RoomDescription> |undefined
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:150
Helper function to get information about the most recent room that is stored in the room history array.
This is useful in the POST_ENTITY_REMOVE callback; see the isLeavingRoom function.
Note that this function can return undefined in the case where it is called on the first room of the run.
In order to use this function, you must upgrade your mod with ISCFeature.ROOM_HISTORY.
Returns
Section titled “Returns”Readonly<RoomDescription> | undefined
inFirstRoom()
Section titled “inFirstRoom()”inFirstRoom():
boolean
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:160
Helper function to detect if the player is on the first room of the room.
Returns
Section titled “Returns”boolean
isLeavingRoom()
Section titled “isLeavingRoom()”isLeavingRoom():
boolean
Defined in: packages/isaacscript-common/src/classes/features/other/RoomHistory.ts:178
Helper function to detect if the game is in the state where the room index has changed to a new
room, but the entities from the previous room are currently in the process of despawning. (At
this point, the POST_NEW_ROOM callback and the POST_NEW_ROOM_EARLY callback will not have
fired yet, and there will not be an entry in the room history array for the current room.)
This function is intended to be used in the POST_ENTITY_REMOVE callback to detect when an
entity is despawning.
In order to use this function, you must upgrade your mod with ISCFeature.ROOM_HISTORY.
Returns
Section titled “Returns”boolean
