isaacscript-common 26.2.0 → 26.3.0

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.
Files changed (50) hide show
  1. package/dist/index.rollup.d.ts +82 -8
  2. package/dist/isaacscript-common.lua +106 -57
  3. package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
  4. package/dist/src/classes/features/other/ModdedElementSets.lua +4 -2
  5. package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
  6. package/dist/src/classes/features/other/Pause.lua +3 -2
  7. package/dist/src/functions/array.d.ts.map +1 -1
  8. package/dist/src/functions/array.lua +3 -2
  9. package/dist/src/functions/doors.d.ts.map +1 -1
  10. package/dist/src/functions/doors.lua +4 -2
  11. package/dist/src/functions/enums.d.ts.map +1 -1
  12. package/dist/src/functions/enums.lua +3 -2
  13. package/dist/src/functions/gridEntities.lua +3 -3
  14. package/dist/src/functions/logMisc.d.ts +51 -8
  15. package/dist/src/functions/logMisc.d.ts.map +1 -1
  16. package/dist/src/functions/logMisc.lua +69 -21
  17. package/dist/src/functions/players.d.ts.map +1 -1
  18. package/dist/src/functions/players.lua +6 -5
  19. package/dist/src/functions/random.d.ts.map +1 -1
  20. package/dist/src/functions/random.lua +3 -2
  21. package/dist/src/functions/roomShapeWalls.d.ts.map +1 -1
  22. package/dist/src/functions/roomShapeWalls.lua +12 -11
  23. package/dist/src/functions/rooms.d.ts.map +1 -1
  24. package/dist/src/functions/rooms.lua +3 -2
  25. package/dist/src/functions/set.d.ts.map +1 -1
  26. package/dist/src/functions/set.lua +3 -1
  27. package/dist/src/functions/utils.d.ts.map +1 -1
  28. package/dist/src/functions/utils.lua +3 -2
  29. package/dist/src/functions/vector.d.ts +7 -0
  30. package/dist/src/functions/vector.d.ts.map +1 -1
  31. package/dist/src/functions/vector.lua +5 -0
  32. package/dist/src/index.d.ts +1 -0
  33. package/dist/src/index.d.ts.map +1 -1
  34. package/dist/src/index.lua +8 -0
  35. package/package.json +1 -1
  36. package/src/classes/features/other/ModdedElementSets.ts +3 -2
  37. package/src/classes/features/other/Pause.ts +2 -1
  38. package/src/functions/array.ts +2 -1
  39. package/src/functions/doors.ts +3 -2
  40. package/src/functions/enums.ts +2 -1
  41. package/src/functions/gridEntities.ts +3 -3
  42. package/src/functions/logMisc.ts +99 -20
  43. package/src/functions/players.ts +5 -4
  44. package/src/functions/random.ts +2 -1
  45. package/src/functions/roomShapeWalls.ts +6 -5
  46. package/src/functions/rooms.ts +2 -1
  47. package/src/functions/set.ts +2 -1
  48. package/src/functions/utils.ts +2 -1
  49. package/src/functions/vector.ts +7 -0
  50. package/src/index.ts +1 -0
@@ -4,7 +4,6 @@ local __TS__New = ____lualib.__TS__New
4
4
  local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
5
5
  local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
6
6
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
7
- local Set = ____lualib.Set
8
7
  local ____exports = {}
9
8
  local getVanillaWallGridIndexSetForRoomShape, getWallGridIndexSetForRectangleRoomShape
10
9
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
@@ -16,6 +15,8 @@ local ____cachedClasses = require("src.core.cachedClasses")
16
15
  local game = ____cachedClasses.game
17
16
  local ____CornerType = require("src.enums.CornerType")
18
17
  local CornerType = ____CornerType.CornerType
18
+ local ____ReadonlySet = require("src.types.ReadonlySet")
19
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
19
20
  local ____gridIndex = require("src.functions.gridIndex")
20
21
  local getGridIndexesBetween = ____gridIndex.getGridIndexesBetween
21
22
  local ____rooms = require("src.functions.rooms")
@@ -36,7 +37,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
36
37
  if ____cond7 then
37
38
  do
38
39
  local topMiddle, topRight, middleLeft, middle, bottomLeft, bottomRight = table.unpack(corners)
39
- local ____Set_1 = Set
40
+ local ____ReadonlySet_1 = ReadonlySet
40
41
  local ____array_0 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topMiddle.gridIndex, topRight.gridIndex, roomShape)))
41
42
  __TS__SparseArrayPush(
42
43
  ____array_0,
@@ -59,7 +60,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
59
60
  table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
60
61
  )
61
62
  return __TS__New(
62
- ____Set_1,
63
+ ____ReadonlySet_1,
63
64
  {__TS__SparseArraySpread(____array_0)}
64
65
  )
65
66
  end
@@ -68,7 +69,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
68
69
  if ____cond7 then
69
70
  do
70
71
  local topLeft, topMiddle, middle, middleRight, bottomLeft, bottomRight = table.unpack(corners)
71
- local ____Set_3 = Set
72
+ local ____ReadonlySet_3 = ReadonlySet
72
73
  local ____array_2 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topMiddle.gridIndex, roomShape)))
73
74
  __TS__SparseArrayPush(
74
75
  ____array_2,
@@ -91,7 +92,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
91
92
  table.unpack(getGridIndexesBetween(nil, middleRight.gridIndex, bottomRight.gridIndex, roomShape))
92
93
  )
93
94
  return __TS__New(
94
- ____Set_3,
95
+ ____ReadonlySet_3,
95
96
  {__TS__SparseArraySpread(____array_2)}
96
97
  )
97
98
  end
@@ -100,7 +101,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
100
101
  if ____cond7 then
101
102
  do
102
103
  local topLeft, topRight, middleLeft, middle, bottomMiddle, bottomRight = table.unpack(corners)
103
- local ____Set_5 = Set
104
+ local ____ReadonlySet_5 = ReadonlySet
104
105
  local ____array_4 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
105
106
  __TS__SparseArrayPush(
106
107
  ____array_4,
@@ -123,7 +124,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
123
124
  table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
124
125
  )
125
126
  return __TS__New(
126
- ____Set_5,
127
+ ____ReadonlySet_5,
127
128
  {__TS__SparseArraySpread(____array_4)}
128
129
  )
129
130
  end
@@ -132,7 +133,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
132
133
  if ____cond7 then
133
134
  do
134
135
  local topLeft, topRight, middle, middleRight, bottomLeft, bottomMiddle = table.unpack(corners)
135
- local ____Set_7 = Set
136
+ local ____ReadonlySet_7 = ReadonlySet
136
137
  local ____array_6 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
137
138
  __TS__SparseArrayPush(
138
139
  ____array_6,
@@ -155,7 +156,7 @@ function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
155
156
  table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, middleRight.gridIndex, roomShape))
156
157
  )
157
158
  return __TS__New(
158
- ____Set_7,
159
+ ____ReadonlySet_7,
159
160
  {__TS__SparseArraySpread(____array_6)}
160
161
  )
161
162
  end
@@ -172,7 +173,7 @@ function getWallGridIndexSetForRectangleRoomShape(self, roomShape, corners)
172
173
  error("Failed to get the correct amount of corners for rectangular room shape.")
173
174
  end
174
175
  local topLeft, topRight, bottomLeft, bottomRight = table.unpack(corners)
175
- local ____Set_9 = Set
176
+ local ____ReadonlySet_9 = ReadonlySet
176
177
  local ____array_8 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
177
178
  __TS__SparseArrayPush(
178
179
  ____array_8,
@@ -187,7 +188,7 @@ function getWallGridIndexSetForRectangleRoomShape(self, roomShape, corners)
187
188
  table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
188
189
  )
189
190
  return __TS__New(
190
- ____Set_9,
191
+ ____ReadonlySet_9,
191
192
  {__TS__SparseArraySpread(____array_8)}
192
193
  )
193
194
  end
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAclC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAOlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAqBlB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,EAAE,CAe1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAWtD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAKnC;AAED,wBAAgB,WAAW,IA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;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -9,7 +9,6 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
9
9
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
10
10
  local __TS__StringIncludes = ____lualib.__TS__StringIncludes
11
11
  local __TS__ArraySome = ____lualib.__TS__ArraySome
12
- local Set = ____lualib.Set
13
12
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
14
13
  local ____exports = {}
15
14
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
@@ -35,6 +34,8 @@ local ____roomTypeNames = require("src.objects.roomTypeNames")
35
34
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
36
35
  local ____mineShaftRoomSubTypesSet = require("src.sets.mineShaftRoomSubTypesSet")
37
36
  local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROOM_SUB_TYPE_SET
37
+ local ____ReadonlySet = require("src.types.ReadonlySet")
38
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
38
39
  local ____dimensions = require("src.functions.dimensions")
39
40
  local getAllDimensions = ____dimensions.getAllDimensions
40
41
  local inDimension = ____dimensions.inDimension
@@ -403,7 +404,7 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
403
404
  if onlyCheckRoomTypes == nil then
404
405
  matchingRooms = rooms
405
406
  else
406
- local roomTypeWhitelist = __TS__New(Set, onlyCheckRoomTypes)
407
+ local roomTypeWhitelist = __TS__New(ReadonlySet, onlyCheckRoomTypes)
407
408
  matchingRooms = __TS__ArrayFilter(
408
409
  rooms,
409
410
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
@@ -1 +1 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/functions/set.ts"],"names":[],"mappings":";;AAIA;;;;;GAKG;AACH,wB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AC,EACnC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAC5B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAO,GAClC,CAAC,CAGH;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAC5B,iBAAiB,EAAE,OAAO,GACzB,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAK/B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAkBvE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,CAI7D;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAGrE"}
@@ -6,6 +6,8 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
6
6
  local __TS__Spread = ____lualib.__TS__Spread
7
7
  local __TS__ArraySort = ____lualib.__TS__ArraySort
8
8
  local ____exports = {}
9
+ local ____ReadonlySet = require("src.types.ReadonlySet")
10
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
9
11
  local ____array = require("src.functions.array")
10
12
  local getArrayCombinations = ____array.getArrayCombinations
11
13
  local getRandomArrayElement = ____array.getRandomArrayElement
@@ -114,7 +116,7 @@ function ____exports.getSetCombinations(self, set, includeEmptyArray)
114
116
  local combinations = getArrayCombinations(nil, values, includeEmptyArray)
115
117
  return __TS__ArrayMap(
116
118
  combinations,
117
- function(____, array) return __TS__New(Set, array) end
119
+ function(____, array) return __TS__New(ReadonlySet, array) end
118
120
  )
119
121
  end
120
122
  --- Helper function to add one or more elements to a set at once without having to repeatedly call
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":";AAKA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAWlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAOlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAetC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI3D;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAG"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":";AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAWlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAOlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAetC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI3D;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAG"}
@@ -1,12 +1,13 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
3
- local Set = ____lualib.Set
4
3
  local __TS__New = ____lualib.__TS__New
5
4
  local ____exports = {}
6
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
6
  local RenderMode = ____isaac_2Dtypescript_2Ddefinitions.RenderMode
8
7
  local ____cachedClasses = require("src.core.cachedClasses")
9
8
  local game = ____cachedClasses.game
9
+ local ____ReadonlySet = require("src.types.ReadonlySet")
10
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
10
11
  local ____playerIndex = require("src.functions.playerIndex")
11
12
  local getAllPlayers = ____playerIndex.getAllPlayers
12
13
  local ____types = require("src.functions.types")
@@ -87,7 +88,7 @@ function ____exports.isMultiplayer(self)
87
88
  players,
88
89
  function(____, player) return player.ControllerIndex end
89
90
  )
90
- local controllerIndexesSet = __TS__New(Set, controllerIndexes)
91
+ local controllerIndexesSet = __TS__New(ReadonlySet, controllerIndexes)
91
92
  return controllerIndexesSet.size > 1
92
93
  end
93
94
  --- Helper function to see if the current render callback is rendering a water reflection.
@@ -55,5 +55,12 @@ export declare function serializeVector(vector: Vector): SerializedVector;
55
55
  export declare function vectorEquals(vector1: Vector, vector2: Vector): boolean;
56
56
  /** Helper function for finding out which way a vector is pointing. */
57
57
  export declare function vectorToDirection(vector: Vector): Direction;
58
+ /**
59
+ * Helper function to convert a vector to a string.
60
+ *
61
+ * @param vector The vector to convert.
62
+ * @param round Optional. If true, will round the vector values to the nearest integer. Default is
63
+ * false.
64
+ */
58
65
  export declare function vectorToString(vector: Vector, round?: boolean): string;
59
66
  //# sourceMappingURL=vector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/functions/vector.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,yBAAyB,EACzB,SAAS,EACV,MAAM,8BAA8B,CAAC;AAatC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,MAAM,CAAC;CACnD,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB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AAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAqBlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,SAAO,GACf,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,QAAQ,CAAC,MAAM,CAAC,CAOlB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gBAAgB,CAM5B;AAED,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAWhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAG3D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,MAAM,CAIpE"}
@@ -119,6 +119,11 @@ function ____exports.vectorToDirection(self, vector)
119
119
  local angleDegrees = vector:GetAngleDegrees()
120
120
  return angleToDirection(nil, angleDegrees)
121
121
  end
122
+ --- Helper function to convert a vector to a string.
123
+ --
124
+ -- @param vector The vector to convert.
125
+ -- @param round Optional. If true, will round the vector values to the nearest integer. Default is
126
+ -- false.
122
127
  function ____exports.vectorToString(self, vector, round)
123
128
  if round == nil then
124
129
  round = false
@@ -93,6 +93,7 @@ export * from "./functions/positionVelocity";
93
93
  export * from "./functions/pressurePlate";
94
94
  export * from "./functions/projectiles";
95
95
  export * from "./functions/random";
96
+ export * from "./functions/readOnly";
96
97
  export * from "./functions/revive";
97
98
  export * from "./functions/rng";
98
99
  export * from "./functions/rockAlt";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,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,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
@@ -759,6 +759,14 @@ do
759
759
  end
760
760
  end
761
761
  end
762
+ do
763
+ local ____export = require("src.functions.readOnly")
764
+ for ____exportKey, ____exportValue in pairs(____export) do
765
+ if ____exportKey ~= "default" then
766
+ ____exports[____exportKey] = ____exportValue
767
+ end
768
+ end
769
+ end
762
770
  do
763
771
  local ____export = require("src.functions.revive")
764
772
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "26.2.0",
3
+ "version": "26.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -43,6 +43,7 @@ import {
43
43
  import { repeat } from "../../../functions/utils";
44
44
  import { ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET } from "../../../sets/itemConfigCardTypesForCardsSet";
45
45
  import { ReadonlyMap } from "../../../types/ReadonlyMap";
46
+ import { ReadonlySet } from "../../../types/ReadonlySet";
46
47
  import { Feature } from "../../private/Feature";
47
48
  import { ModdedElementDetection } from "./ModdedElementDetection";
48
49
 
@@ -614,7 +615,7 @@ export class ModdedElementSets extends Feature {
614
615
 
615
616
  const collectiblesSet = this.cacheFlagToCollectibleTypesMap.get(cacheFlag);
616
617
  if (collectiblesSet === undefined) {
617
- return new Set();
618
+ return new ReadonlySet();
618
619
  }
619
620
 
620
621
  return collectiblesSet;
@@ -1167,7 +1168,7 @@ export class ModdedElementSets extends Feature {
1167
1168
 
1168
1169
  const trinketsSet = this.cacheFlagToTrinketTypesMap.get(cacheFlag);
1169
1170
  if (trinketsSet === undefined) {
1170
- return new Set();
1171
+ return new ReadonlySet();
1171
1172
  }
1172
1173
 
1173
1174
  return trinketsSet;
@@ -17,6 +17,7 @@ import { logError } from "../../../functions/logMisc";
17
17
  import { getAllPlayers } from "../../../functions/playerIndex";
18
18
  import { useActiveItemTemp } from "../../../functions/players";
19
19
  import { getTSTLClassName } from "../../../functions/tstlClass";
20
+ import { ReadonlySet } from "../../../types/ReadonlySet";
20
21
  import { Feature } from "../../private/Feature";
21
22
  import { DisableInputs } from "./DisableInputs";
22
23
 
@@ -173,7 +174,7 @@ export class Pause extends Feature {
173
174
  error("Failed to get the class name for the pause feature.");
174
175
  }
175
176
 
176
- const whitelist = new Set([
177
+ const whitelist = new ReadonlySet([
177
178
  ButtonAction.MENU_CONFIRM,
178
179
  ButtonAction.CONSOLE,
179
180
  ]);
@@ -1,3 +1,4 @@
1
+ import { ReadonlySet } from "../types/ReadonlySet";
1
2
  import { getRandomInt } from "./random";
2
3
  import { getRandomSeed, isRNG, newRNG } from "./rng";
3
4
  import { isNumber, isTable } from "./types";
@@ -131,7 +132,7 @@ export function arrayRemoveIndex<T>(
131
132
  originalArray: T[] | readonly T[],
132
133
  ...indexesToRemove: int[]
133
134
  ): T[] {
134
- const indexesToRemoveSet = new Set(indexesToRemove);
135
+ const indexesToRemoveSet = new ReadonlySet(indexesToRemove);
135
136
 
136
137
  const array: T[] = [];
137
138
  originalArray.forEach((element, i) => {
@@ -24,6 +24,7 @@ import { DOOR_SLOT_TO_DOOR_SLOT_FLAG } from "../objects/doorSlotToDoorSlotFlag";
24
24
  import { OPPOSITE_DOOR_SLOTS } from "../objects/oppositeDoorSlots";
25
25
  import { ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES } from "../objects/roomShapeToDoorSlotCoordinates";
26
26
  import { ROOM_SHAPE_TO_DOOR_SLOTS } from "../objects/roomShapeToDoorSlots";
27
+ import { ReadonlySet } from "../types/ReadonlySet";
27
28
  import { arrayToBitFlags } from "./bitwise";
28
29
  import { directionToVector } from "./direction";
29
30
  import { hasFlag } from "./flag";
@@ -189,7 +190,7 @@ export function getDoorSlotsForRoomShape(
189
190
  export function getDoors(...roomTypes: RoomType[]): GridEntityDoor[] {
190
191
  const room = game.GetRoom();
191
192
  const roomShape = room.GetRoomShape();
192
- const roomTypesSet = new Set(roomTypes);
193
+ const roomTypesSet = new ReadonlySet(roomTypes);
193
194
 
194
195
  // We iterate over the possible door slots for this room shape instead of all door slots in order
195
196
  // to prevent crashes from accessing invalid memory.
@@ -223,7 +224,7 @@ export function getDoors(...roomTypes: RoomType[]): GridEntityDoor[] {
223
224
  * that match any of the N room grid indexes.
224
225
  */
225
226
  export function getDoorsToRoomIndex(...roomGridIndex: int[]): GridEntityDoor[] {
226
- const roomGridIndexesSet = new Set(roomGridIndex);
227
+ const roomGridIndexesSet = new ReadonlySet(roomGridIndex);
227
228
  const doors = getDoors();
228
229
  return doors.filter((door) => roomGridIndexesSet.has(door.TargetRoomIndex));
229
230
  }
@@ -1,3 +1,4 @@
1
+ import { ReadonlySet } from "../types/ReadonlySet";
1
2
  import { getRandomArrayElement } from "./array";
2
3
  import { getRandomSeed } from "./rng";
3
4
  import { isString } from "./types";
@@ -177,7 +178,7 @@ export function validateEnumContiguous<T>(
177
178
  );
178
179
  }
179
180
 
180
- const valuesSet = new Set(values);
181
+ const valuesSet = new ReadonlySet(values);
181
182
  for (const value of iRange(lastValue)) {
182
183
  if (!valuesSet.has(value as unknown as T[keyof T])) {
183
184
  error(
@@ -185,7 +185,7 @@ export function getGridEntities(
185
185
  return gridEntities;
186
186
  }
187
187
 
188
- const gridEntityTypesSet = new Set(gridEntityTypes);
188
+ const gridEntityTypesSet = new ReadonlySet(gridEntityTypes);
189
189
  return gridEntities.filter((gridEntity) => {
190
190
  const gridEntityType = gridEntity.GetType();
191
191
  return gridEntityTypesSet.has(gridEntityType);
@@ -221,7 +221,7 @@ export function getGridEntitiesExcept(
221
221
  return gridEntities;
222
222
  }
223
223
 
224
- const gridEntityTypesSet = new Set(gridEntityTypes);
224
+ const gridEntityTypesSet = new ReadonlySet(gridEntityTypes);
225
225
  return gridEntities.filter((gridEntity) => {
226
226
  const gridEntityType = gridEntity.GetType();
227
227
  return !gridEntityTypesSet.has(gridEntityType);
@@ -463,7 +463,7 @@ export function isPostBossVoidPortal(gridEntity: GridEntity): boolean {
463
463
  export function removeAllGridEntitiesExcept(
464
464
  ...gridEntityTypes: GridEntityType[]
465
465
  ): GridEntity[] {
466
- const gridEntityTypeExceptions = new Set(gridEntityTypes);
466
+ const gridEntityTypeExceptions = new ReadonlySet(gridEntityTypes);
467
467
  const gridEntities = getGridEntities();
468
468
  const removedGridEntities: GridEntity[] = [];
469
469
  for (const gridEntity of gridEntities) {
@@ -14,13 +14,14 @@ import {
14
14
  UseFlag,
15
15
  } from "isaac-typescript-definitions";
16
16
  import { game, musicManager, sfxManager } from "../core/cachedClasses";
17
+ import { ReadonlySet } from "../types/ReadonlySet";
17
18
  import { arrayToString, isArray } from "./array";
18
19
  import { getCollectibleName } from "./collectibles";
19
20
  import { getEntityID } from "./entities";
20
21
  import { getEnumEntries } from "./enums";
21
22
  import { hasFlag } from "./flag";
22
23
  import { getIsaacAPIClassName } from "./isaacAPIClass";
23
- import { log } from "./log";
24
+ import { log, logAndPrint } from "./log";
24
25
  import { getPlayerHealth } from "./playerHealth";
25
26
  import { getEffectsList, getPlayerName } from "./players";
26
27
  import { getRoomData, getRoomGridIndex, getRoomListIndex } from "./roomData";
@@ -31,8 +32,17 @@ import { isDefaultMap, isTSTLMap, isTSTLSet } from "./tstlClass";
31
32
  import { isTable, isUserdata } from "./types";
32
33
  import { vectorToString } from "./vector";
33
34
 
34
- /** Helper function to enumerate all of the values in an array. */
35
- export function logArray<T>(this: void, array: T[] | readonly T[]): void {
35
+ /**
36
+ * Helper function to log all of the values in an array.
37
+ *
38
+ * @param array The array to log.
39
+ * @param name Optional. The name of the array, which will be logged before the elements.
40
+ */
41
+ export function logArray<T>(
42
+ this: void,
43
+ array: T[] | readonly T[],
44
+ name?: string,
45
+ ): void {
36
46
  // We do not assume the given array has contiguous values in order to be more permissive about the
37
47
  // kinds of arrays that will successfully log without a run-time error.
38
48
  if (!isArray(array, false)) {
@@ -41,14 +51,28 @@ export function logArray<T>(this: void, array: T[] | readonly T[]): void {
41
51
  }
42
52
 
43
53
  const arrayString = arrayToString(array);
44
- log(`Array: ${arrayString}`);
54
+ if (name === undefined) {
55
+ name = "array";
56
+ }
57
+ log(`Logging ${name}: ${arrayString}`);
45
58
  }
46
59
 
60
+ /**
61
+ * Helper function to log the names of a collectible type array.
62
+ *
63
+ * @param collectibleTypes The collectible types to log.
64
+ * @param name Optional. The name of the array, which will be logged before the elements.
65
+ */
47
66
  export function logCollectibleTypes(
48
67
  this: void,
49
68
  collectibleTypes: CollectibleType[],
69
+ name?: string,
50
70
  ): void {
51
- log("Collectibles:");
71
+ if (name === undefined) {
72
+ name = "collectibles";
73
+ }
74
+
75
+ log(`Logging ${name}:`);
52
76
 
53
77
  let i = 1;
54
78
  for (const collectibleType of collectibleTypes) {
@@ -58,9 +82,19 @@ export function logCollectibleTypes(
58
82
  }
59
83
  }
60
84
 
61
- export function logColor(this: void, color: Color): void {
85
+ /**
86
+ * Helper function to log a `Color` object.
87
+ *
88
+ * @param color The `Color` object to log.
89
+ * @param name Optional. The name of the object, which will be logged before the properties.
90
+ */
91
+ export function logColor(this: void, color: Color, name?: string): void {
92
+ if (name === undefined) {
93
+ name = "color";
94
+ }
95
+
62
96
  log(
63
- `Color: R${color.R}, G${color.G}, B${color.B}, A${color.A}, RO${color.RO}, BO${color.BO}, GO${color.GO}`,
97
+ `Logging ${name}: R${color.R}, G${color.G}, B${color.B}, A${color.A}, RO${color.RO}, BO${color.BO}, GO${color.GO}`,
64
98
  );
65
99
  }
66
100
 
@@ -82,7 +116,7 @@ export function logEntityFlags(
82
116
 
83
117
  export function logEntityID(this: void, entity: Entity): void {
84
118
  const entityID = getEntityID(entity);
85
- log(`Entity: ${entityID}`);
119
+ log(`Logging entity: ${entityID}`);
86
120
  }
87
121
 
88
122
  /**
@@ -93,8 +127,7 @@ export function logEntityID(this: void, entity: Entity): void {
93
127
  */
94
128
  export function logError(this: void, msg: string): void {
95
129
  const errorMsg = `Error: ${msg}`;
96
- log(errorMsg);
97
- print(errorMsg);
130
+ logAndPrint(errorMsg);
98
131
  }
99
132
 
100
133
  /** Helper function for printing out every flag that is turned on. Useful when debugging. */
@@ -146,9 +179,19 @@ export function logGameStateFlags(this: void): void {
146
179
  }
147
180
  }
148
181
 
149
- export function logKColor(this: void, kColor: KColor): void {
182
+ /**
183
+ * Helper function to log a `KColor` object.
184
+ *
185
+ * @param kColor The `KColor` object to log.
186
+ * @param name Optional. The name of the object, which will be logged before the properties.
187
+ */
188
+ export function logKColor(this: void, kColor: KColor, name?: string): void {
189
+ if (name === undefined) {
190
+ name = "KColor";
191
+ }
192
+
150
193
  log(
151
- `Color: R${kColor.Red}, G${kColor.Green}, B${kColor.Blue}, A${kColor.Alpha}`,
194
+ `Logging ${name}: R${kColor.Red}, G${kColor.Green}, B${kColor.Blue}, A${kColor.Alpha}`,
152
195
  );
153
196
  }
154
197
 
@@ -175,13 +218,24 @@ export function logLevelStateFlags(this: void): void {
175
218
  }
176
219
  }
177
220
 
178
- export function logMap(this: void, map: Map<AnyNotNil, unknown>): void {
221
+ /**
222
+ * Helper function to log a TSTL `Map`.
223
+ *
224
+ * @param map The TSTL `Map` to log.
225
+ * @param name Optional. The name of the map, which will be logged before the elements.
226
+ */
227
+ export function logMap(
228
+ this: void,
229
+ map: Map<AnyNotNil, unknown>,
230
+ name?: string,
231
+ ): void {
179
232
  if (!isTSTLMap(map) && !isDefaultMap(map)) {
180
233
  log("Tried to log a TSTL map, but the given object was not a TSTL map.");
181
234
  return;
182
235
  }
183
236
 
184
- log("Printing out a TSTL map:");
237
+ const suffix = name === undefined ? ` "${name}"` : "";
238
+ log(`Printing out a TSTL map${suffix}:`);
185
239
 
186
240
  const mapKeys = [...map.keys()];
187
241
  mapKeys.sort();
@@ -270,7 +324,7 @@ export function logRoom(this: void): void {
270
324
  const roomListIndex = getRoomListIndex();
271
325
  const roomData = getRoomData();
272
326
 
273
- log("Current room information:");
327
+ log("Logging room information:");
274
328
  if (roomData === undefined) {
275
329
  log("- Room data is undefined.");
276
330
  } else {
@@ -315,16 +369,24 @@ export function logSeedEffects(this: void): void {
315
369
  }
316
370
  }
317
371
 
372
+ /**
373
+ * Helper function to log a TSTL `Set`.
374
+ *
375
+ * @param set The TSTL `Set` to log.
376
+ * @param name Optional. The name of the set, which will be logged before the elements.
377
+ */
318
378
  export function logSet(
319
379
  this: void,
320
380
  set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>,
381
+ name?: string,
321
382
  ): void {
322
383
  if (!isTSTLSet(set)) {
323
384
  log("Tried to log a TSTL set, but the given object was not a TSTL set.");
324
385
  return;
325
386
  }
326
387
 
327
- log("Printing out a TSTL set:");
388
+ const suffix = name === undefined ? ` "${name}"` : "";
389
+ log(`Printing out a TSTL set${suffix}:`);
328
390
 
329
391
  const setValues = getSortedSetValues(set);
330
392
  for (const value of setValues) {
@@ -413,10 +475,10 @@ export function logTableDifferences<K extends AnyNotNil, V>(
413
475
  log("Comparing two Lua tables:");
414
476
 
415
477
  const table1Keys = Object.keys(table1);
416
- const table1KeysSet = new Set(table1Keys);
478
+ const table1KeysSet = new ReadonlySet(table1Keys);
417
479
 
418
480
  const table2Keys = Object.keys(table2);
419
- const table2KeysSet = new Set(table2Keys);
481
+ const table2KeysSet = new ReadonlySet(table2Keys);
420
482
 
421
483
  const keysSet = combineSets(table1KeysSet, table2KeysSet);
422
484
  const keys = [...keysSet.values()];
@@ -509,7 +571,24 @@ export function logUserdata(this: void, userdata: unknown): void {
509
571
  logTable(metatable);
510
572
  }
511
573
 
512
- export function logVector(this: void, vector: Vector, round = false): void {
574
+ /**
575
+ * Helper function to log a `Vector` object.
576
+ *
577
+ * @param vector The `Vector` object to log.
578
+ * @param name Optional. The name of the object, which will be logged before the properties.
579
+ * @param round Optional. If true, will round the vector values to the nearest integer. Default is
580
+ * false.
581
+ */
582
+ export function logVector(
583
+ this: void,
584
+ vector: Vector,
585
+ name?: string,
586
+ round = false,
587
+ ): void {
588
+ if (name === undefined) {
589
+ name = "vector";
590
+ }
591
+
513
592
  const vectorString = vectorToString(vector, round);
514
- log(`Vector: ${vectorString}`);
593
+ log(`Logging ${name}: ${vectorString}`);
515
594
  }