Skip to main content

Grid Index

Functions

getGridIndexesBetween

getGridIndexesBetween(gridIndex1, gridIndex2, roomShape): readonly int[]

Helper function to get all of the grid indexes between two grid indexes on either a horizontal or vertical line, inclusive on both ends.

If the first grid index is greater than the second grid index, the two will be swapped.

This function will throw a run-time error if the two provided grid indexes are not on the same horizontal or vertical line.

Parameters

NameType
gridIndex1int
gridIndex2int
roomShapeRoomShape

Returns

readonly int[]

Defined in

packages/isaacscript-common/src/functions/gridIndex.ts:14