isaacscript-common 1.0.337 → 1.0.338

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,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
3
  function ____exports.getKBitOfN(self, k, n)
4
- return (n & (1 << k)) >> k
4
+ return (n >> k) & 1
5
5
  end
6
6
  function ____exports.getNumBitsOfN(self, n)
7
7
  local numBits = 0
@@ -36,6 +36,12 @@ export declare function getRoomIndex(): int;
36
36
  * This function only searches through rooms in the current dimension.
37
37
  */
38
38
  export declare function getRoomIndexesForType(roomType: RoomType): Set<int>;
39
+ /**
40
+ * Helper function to get the name of the room as it appears in the STB/XML data.
41
+ *
42
+ * @returns The room name. Returns "Unknown" if the type was not found.
43
+ */
44
+ export declare function getRoomName(): string;
39
45
  /**
40
46
  * Helper function to get the stage ID for the room from the XML/STB data. The room stage ID will
41
47
  * correspond to the first number in the filename of the XML/STB file. For example, a Depths room
@@ -75,6 +75,13 @@ function ____exports.getRoomIndexesForType(self, roomType)
75
75
  end
76
76
  return roomIndexes
77
77
  end
78
+ function ____exports.getRoomName(self)
79
+ local roomData = ____exports.getRoomData(nil)
80
+ if roomData == nil then
81
+ return "Unknown"
82
+ end
83
+ return roomData.Name
84
+ end
78
85
  function ____exports.getRoomStageID(self)
79
86
  local roomData = ____exports.getRoomData(nil)
80
87
  if roomData == nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.337",
3
+ "version": "1.0.338",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,7 +25,7 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "isaac-typescript-definitions": "^1.0.201",
28
+ "isaac-typescript-definitions": "^1.0.207",
29
29
  "isaacscript-lint": "^1.0.61",
30
30
  "typedoc": "^0.22.5",
31
31
  "typescript": "4.4.3",