isaacscript-common 14.1.2 → 14.2.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 (494) hide show
  1. package/dist/index.d.ts +954 -158
  2. package/dist/isaacscript-common.lua +4099 -1066
  3. package/dist/src/callbacks.d.ts +102 -20
  4. package/dist/src/callbacks.d.ts.map +1 -1
  5. package/dist/src/callbacks.lua +124 -1
  6. package/dist/src/classes/ModFeature.d.ts +16 -4
  7. package/dist/src/classes/ModFeature.d.ts.map +1 -1
  8. package/dist/src/classes/ModFeature.lua +67 -4
  9. package/dist/src/classes/ModUpgraded.d.ts +10 -10
  10. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  11. package/dist/src/classes/ModUpgraded.lua +35 -16
  12. package/dist/src/classes/callbacks/PostCustomRevive.d.ts +5 -2
  13. package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
  14. package/dist/src/classes/callbacks/PostCustomRevive.lua +12 -4
  15. package/dist/src/classes/callbacks/PostGridEntityBroken.lua +1 -1
  16. package/dist/src/classes/callbacks/PostGridEntityCollision.lua +1 -1
  17. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.lua +1 -1
  18. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.lua +1 -1
  19. package/dist/src/classes/callbacks/PostGridEntityCustomInit.lua +1 -1
  20. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.lua +1 -1
  21. package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts +6 -0
  22. package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts.map +1 -0
  23. package/dist/src/classes/callbacks/PostGridEntityCustomRender.lua +17 -0
  24. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.lua +1 -1
  25. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.lua +1 -1
  26. package/dist/src/classes/callbacks/PostGridEntityInit.lua +1 -1
  27. package/dist/src/classes/callbacks/PostGridEntityRemove.lua +1 -1
  28. package/dist/src/classes/callbacks/PostGridEntityRender.d.ts +6 -0
  29. package/dist/src/classes/callbacks/PostGridEntityRender.d.ts.map +1 -0
  30. package/dist/src/classes/callbacks/PostGridEntityRender.lua +17 -0
  31. package/dist/src/classes/callbacks/PostGridEntityStateChanged.lua +1 -1
  32. package/dist/src/classes/callbacks/PostGridEntityUpdate.lua +1 -1
  33. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts +1 -1
  34. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -1
  35. package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +3 -4
  36. package/dist/src/classes/callbacks/PostItemDischarge.d.ts +43 -0
  37. package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -0
  38. package/dist/src/classes/callbacks/PostItemDischarge.lua +113 -0
  39. package/dist/src/classes/callbacks/PostItemPickup.d.ts +6 -0
  40. package/dist/src/classes/callbacks/PostItemPickup.d.ts.map +1 -0
  41. package/dist/src/classes/callbacks/PostItemPickup.lua +17 -0
  42. package/dist/src/classes/callbacks/PostLaserInitLate.d.ts +12 -0
  43. package/dist/src/classes/callbacks/PostLaserInitLate.d.ts.map +1 -0
  44. package/dist/src/classes/callbacks/PostLaserInitLate.lua +27 -0
  45. package/dist/src/classes/callbacks/PostNPCInitLate.d.ts +12 -0
  46. package/dist/src/classes/callbacks/PostNPCInitLate.d.ts.map +1 -0
  47. package/dist/src/classes/callbacks/PostNPCInitLate.lua +27 -0
  48. package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts +14 -0
  49. package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts.map +1 -0
  50. package/dist/src/classes/callbacks/PostNPCStateChanged.lua +33 -0
  51. package/dist/src/classes/callbacks/PostPickupCollect.d.ts +12 -0
  52. package/dist/src/classes/callbacks/PostPickupCollect.d.ts.map +1 -0
  53. package/dist/src/classes/callbacks/PostPickupCollect.lua +35 -0
  54. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts +12 -0
  55. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -0
  56. package/dist/src/classes/callbacks/PostPickupInitFirst.lua +32 -0
  57. package/dist/src/classes/callbacks/PostPickupInitLate.d.ts +12 -0
  58. package/dist/src/classes/callbacks/PostPickupInitLate.d.ts.map +1 -0
  59. package/dist/src/classes/callbacks/PostPickupInitLate.lua +27 -0
  60. package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts +13 -0
  61. package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts.map +1 -0
  62. package/dist/src/classes/callbacks/PostPickupStateChanged.lua +33 -0
  63. package/dist/src/classes/callbacks/PostPitUpdate.d.ts +7 -0
  64. package/dist/src/classes/callbacks/PostPitUpdate.d.ts.map +1 -0
  65. package/dist/src/classes/callbacks/PostPitUpdate.lua +24 -0
  66. package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts +15 -0
  67. package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts.map +1 -0
  68. package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +52 -0
  69. package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts +16 -0
  70. package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts.map +1 -0
  71. package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +94 -0
  72. package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts +15 -0
  73. package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts.map +1 -0
  74. package/dist/src/classes/callbacks/PostPlayerChangeType.lua +37 -0
  75. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts +6 -0
  76. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts.map +1 -0
  77. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.lua +17 -0
  78. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts +6 -0
  79. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts.map +1 -0
  80. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.lua +17 -0
  81. package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts +8 -0
  82. package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts.map +1 -0
  83. package/dist/src/classes/callbacks/PostPlayerInitFirst.lua +39 -0
  84. package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts +13 -0
  85. package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts.map +1 -0
  86. package/dist/src/classes/callbacks/PostPlayerInitLate.lua +29 -0
  87. package/dist/src/classes/callbacks/PostPoopRender.d.ts +7 -0
  88. package/dist/src/classes/callbacks/PostPoopRender.d.ts.map +1 -0
  89. package/dist/src/classes/callbacks/PostPoopRender.lua +24 -0
  90. package/dist/src/classes/callbacks/PostPoopUpdate.d.ts +7 -0
  91. package/dist/src/classes/callbacks/PostPoopUpdate.d.ts.map +1 -0
  92. package/dist/src/classes/callbacks/PostPoopUpdate.lua +24 -0
  93. package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts +7 -0
  94. package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts.map +1 -0
  95. package/dist/src/classes/callbacks/PostPressurePlateRender.lua +24 -0
  96. package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts +7 -0
  97. package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts.map +1 -0
  98. package/dist/src/classes/callbacks/PostPressurePlateUpdate.lua +24 -0
  99. package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts +12 -0
  100. package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts.map +1 -0
  101. package/dist/src/classes/callbacks/PostProjectileInitLate.lua +27 -0
  102. package/dist/src/classes/callbacks/PostPurchase.d.ts +18 -0
  103. package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -0
  104. package/dist/src/classes/callbacks/PostPurchase.lua +56 -0
  105. package/dist/src/classes/callbacks/PostRockRender.d.ts +7 -0
  106. package/dist/src/classes/callbacks/PostRockRender.d.ts.map +1 -0
  107. package/dist/src/classes/callbacks/PostRockRender.lua +24 -0
  108. package/dist/src/classes/callbacks/PostRockUpdate.d.ts +7 -0
  109. package/dist/src/classes/callbacks/PostRockUpdate.d.ts.map +1 -0
  110. package/dist/src/classes/callbacks/PostRockUpdate.lua +24 -0
  111. package/dist/src/classes/callbacks/PostSacrifice.d.ts +15 -0
  112. package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -0
  113. package/dist/src/classes/callbacks/PostSacrifice.lua +52 -0
  114. package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts +6 -0
  115. package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts.map +1 -0
  116. package/dist/src/classes/callbacks/PostSlotAnimationChanged.lua +17 -0
  117. package/dist/src/classes/callbacks/PostSlotCollision.d.ts +7 -0
  118. package/dist/src/classes/callbacks/PostSlotCollision.d.ts.map +1 -0
  119. package/dist/src/classes/callbacks/PostSlotCollision.lua +25 -0
  120. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +14 -0
  121. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -0
  122. package/dist/src/classes/callbacks/PostSlotDestroyed.lua +65 -0
  123. package/dist/src/classes/callbacks/PostSlotInit.d.ts +6 -0
  124. package/dist/src/classes/callbacks/PostSlotInit.d.ts.map +1 -0
  125. package/dist/src/classes/callbacks/PostSlotInit.lua +17 -0
  126. package/dist/src/classes/callbacks/PostSlotRender.d.ts +6 -0
  127. package/dist/src/classes/callbacks/PostSlotRender.d.ts.map +1 -0
  128. package/dist/src/classes/callbacks/PostSlotRender.lua +17 -0
  129. package/dist/src/classes/callbacks/PostSlotUpdate.d.ts +6 -0
  130. package/dist/src/classes/callbacks/PostSlotUpdate.d.ts.map +1 -0
  131. package/dist/src/classes/callbacks/PostSlotUpdate.lua +17 -0
  132. package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts +7 -0
  133. package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts.map +1 -0
  134. package/dist/src/classes/callbacks/PostSpikesUpdate.lua +24 -0
  135. package/dist/src/classes/callbacks/PostTNTRender.d.ts +7 -0
  136. package/dist/src/classes/callbacks/PostTNTRender.d.ts.map +1 -0
  137. package/dist/src/classes/callbacks/PostTNTRender.lua +24 -0
  138. package/dist/src/classes/callbacks/PostTNTUpdate.d.ts +7 -0
  139. package/dist/src/classes/callbacks/PostTNTUpdate.d.ts.map +1 -0
  140. package/dist/src/classes/callbacks/PostTNTUpdate.lua +24 -0
  141. package/dist/src/classes/callbacks/PostTearInitLate.d.ts +12 -0
  142. package/dist/src/classes/callbacks/PostTearInitLate.d.ts.map +1 -0
  143. package/dist/src/classes/callbacks/PostTearInitLate.lua +27 -0
  144. package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts +12 -0
  145. package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts.map +1 -0
  146. package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +30 -0
  147. package/dist/src/classes/callbacks/PostTransformation.d.ts +18 -0
  148. package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -0
  149. package/dist/src/classes/callbacks/PostTransformation.lua +53 -0
  150. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts +1 -1
  151. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts.map +1 -1
  152. package/dist/src/classes/callbacks/PreBerserkDeath.lua +3 -4
  153. package/dist/src/classes/callbacks/PreItemPickup.d.ts +6 -0
  154. package/dist/src/classes/callbacks/PreItemPickup.d.ts.map +1 -0
  155. package/dist/src/classes/callbacks/PreItemPickup.lua +17 -0
  156. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts +10 -0
  157. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts.map +1 -0
  158. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.lua +19 -0
  159. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts +11 -0
  160. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts.map +1 -0
  161. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.lua +22 -0
  162. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts +10 -0
  163. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts.map +1 -0
  164. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.lua +19 -0
  165. package/dist/src/classes/callbacks/validation/{CustomCallbackRevive.d.ts → CustomCallbackNPC.d.ts} +4 -4
  166. package/dist/src/classes/callbacks/validation/CustomCallbackNPC.d.ts.map +1 -0
  167. package/dist/src/classes/callbacks/validation/CustomCallbackNPC.lua +22 -0
  168. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts +12 -0
  169. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts.map +1 -0
  170. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.lua +22 -0
  171. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +5 -2
  172. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -1
  173. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts +10 -0
  174. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts.map +1 -0
  175. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.lua +20 -0
  176. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts +10 -0
  177. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts.map +1 -0
  178. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.lua +20 -0
  179. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts +10 -0
  180. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts.map +1 -0
  181. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.lua +19 -0
  182. package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts +10 -0
  183. package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts.map +1 -0
  184. package/dist/src/classes/callbacks/validation/CustomCallbackRock.lua +20 -0
  185. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts +12 -0
  186. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts.map +1 -0
  187. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.lua +19 -0
  188. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.lua +4 -4
  189. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts +10 -0
  190. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts.map +1 -0
  191. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.lua +20 -0
  192. package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts +10 -0
  193. package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts.map +1 -0
  194. package/dist/src/classes/callbacks/validation/CustomCallbackTear.lua +19 -0
  195. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
  196. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  197. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +27 -30
  198. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +2 -2
  199. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
  200. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +6 -6
  201. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
  202. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  203. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +3 -18
  204. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
  205. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts +12 -0
  206. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts.map +1 -0
  207. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.lua +33 -0
  208. package/dist/src/classes/features/callbackLogic/{GridEntityDetection.d.ts → GridEntityUpdateDetection.d.ts} +3 -3
  209. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -0
  210. package/dist/src/classes/features/callbackLogic/{GridEntityDetection.lua → GridEntityUpdateDetection.lua} +11 -14
  211. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +20 -0
  212. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -0
  213. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +60 -0
  214. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +47 -0
  215. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -0
  216. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +154 -0
  217. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts +18 -0
  218. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -0
  219. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +51 -0
  220. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts +17 -0
  221. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -0
  222. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +45 -0
  223. package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
  224. package/dist/src/classes/features/other/RunInNFrames.lua +9 -0
  225. package/dist/src/classes/features/other/SaveDataManager.d.ts +215 -0
  226. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -0
  227. package/dist/src/classes/features/other/SaveDataManager.lua +190 -0
  228. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts +6 -0
  229. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts.map +1 -0
  230. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.lua +98 -0
  231. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts +6 -0
  232. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts.map +1 -0
  233. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +81 -0
  234. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts +7 -0
  235. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts.map +1 -0
  236. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +69 -0
  237. package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts +5 -0
  238. package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts.map +1 -0
  239. package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +46 -0
  240. package/dist/src/classes/private/CustomCallback.d.ts +2 -3
  241. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
  242. package/dist/src/classes/private/CustomCallback.lua +2 -5
  243. package/dist/src/classes/private/Feature.d.ts +1 -0
  244. package/dist/src/classes/private/Feature.d.ts.map +1 -1
  245. package/dist/src/classes/private/Feature.lua +1 -0
  246. package/dist/src/core/upgradeMod.d.ts +2 -5
  247. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  248. package/dist/src/decorators.d.ts +1 -1
  249. package/dist/src/decorators.d.ts.map +1 -1
  250. package/dist/src/decorators.lua +6 -8
  251. package/dist/src/enums/ISCFeature.d.ts +15 -9
  252. package/dist/src/enums/ISCFeature.d.ts.map +1 -1
  253. package/dist/src/enums/ISCFeature.lua +30 -9
  254. package/dist/src/enums/ModCallbackCustom.d.ts +34 -20
  255. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  256. package/dist/src/enums/ModCallbackCustom2.d.ts +61 -20
  257. package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -1
  258. package/dist/src/enums/ModCallbackCustom2.lua +102 -20
  259. package/dist/src/enums/{private/SerializationBrand.d.ts → SerializationBrand.d.ts} +6 -1
  260. package/dist/src/enums/SerializationBrand.d.ts.map +1 -0
  261. package/dist/src/enums/{private/SerializationBrand.lua → SerializationBrand.lua} +1 -0
  262. package/dist/src/features/customItemPool.d.ts +52 -0
  263. package/dist/src/features/customItemPool.d.ts.map +1 -0
  264. package/dist/src/features/customItemPool.lua +111 -0
  265. package/dist/src/features/deployJSONRoom.d.ts +6 -4
  266. package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
  267. package/dist/src/features/deployJSONRoom.lua +6 -4
  268. package/dist/src/features/fadeInRemover.d.ts.map +1 -1
  269. package/dist/src/features/fadeInRemover.lua +4 -16
  270. package/dist/src/features/saveDataManager/exports.d.ts +14 -4
  271. package/dist/src/features/saveDataManager/exports.d.ts.map +1 -1
  272. package/dist/src/features/saveDataManager/exports.lua +38 -0
  273. package/dist/src/features/saveDataManager/load.d.ts +2 -1
  274. package/dist/src/features/saveDataManager/load.d.ts.map +1 -1
  275. package/dist/src/features/saveDataManager/load.lua +10 -4
  276. package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
  277. package/dist/src/features/saveDataManager/main.lua +12 -5
  278. package/dist/src/features/saveDataManager/maps.d.ts +14 -0
  279. package/dist/src/features/saveDataManager/maps.d.ts.map +1 -1
  280. package/dist/src/features/saveDataManager/maps.lua +7 -0
  281. package/dist/src/features.d.ts +31 -12
  282. package/dist/src/features.d.ts.map +1 -1
  283. package/dist/src/features.lua +24 -6
  284. package/dist/src/functions/array.d.ts.map +1 -1
  285. package/dist/src/functions/array.lua +4 -5
  286. package/dist/src/functions/bitSet128.d.ts +2 -2
  287. package/dist/src/functions/bitSet128.lua +3 -3
  288. package/dist/src/functions/color.d.ts +2 -2
  289. package/dist/src/functions/color.lua +3 -3
  290. package/dist/src/functions/decorators.d.ts +28 -6
  291. package/dist/src/functions/decorators.d.ts.map +1 -1
  292. package/dist/src/functions/decorators.lua +24 -5
  293. package/dist/src/functions/deepCopy.d.ts +11 -4
  294. package/dist/src/functions/deepCopy.d.ts.map +1 -1
  295. package/dist/src/functions/deepCopy.lua +84 -32
  296. package/dist/src/functions/deepCopyTests.lua +1 -1
  297. package/dist/src/functions/initArray.d.ts +4 -4
  298. package/dist/src/functions/initArray.d.ts.map +1 -1
  299. package/dist/src/functions/initArray.lua +6 -12
  300. package/dist/src/functions/jsonRoom.d.ts +11 -0
  301. package/dist/src/functions/jsonRoom.d.ts.map +1 -1
  302. package/dist/src/functions/jsonRoom.lua +11 -0
  303. package/dist/src/functions/kColor.d.ts +2 -2
  304. package/dist/src/functions/kColor.lua +3 -3
  305. package/dist/src/functions/logMisc.d.ts +9 -2
  306. package/dist/src/functions/logMisc.d.ts.map +1 -1
  307. package/dist/src/functions/logMisc.lua +32 -2
  308. package/dist/src/functions/merge.d.ts +40 -0
  309. package/dist/src/functions/merge.d.ts.map +1 -0
  310. package/dist/src/{features/saveDataManager → functions}/merge.lua +84 -37
  311. package/dist/src/functions/mergeTests.d.ts +1 -2
  312. package/dist/src/functions/mergeTests.d.ts.map +1 -1
  313. package/dist/src/functions/mergeTests.lua +3 -4
  314. package/dist/src/functions/rng.d.ts +2 -2
  315. package/dist/src/functions/rng.lua +3 -3
  316. package/dist/src/functions/serialization.d.ts.map +1 -1
  317. package/dist/src/functions/serialization.lua +22 -0
  318. package/dist/src/functions/tstlClass.d.ts +0 -10
  319. package/dist/src/functions/tstlClass.d.ts.map +1 -1
  320. package/dist/src/functions/tstlClass.lua +2 -42
  321. package/dist/src/functions/vector.d.ts +2 -2
  322. package/dist/src/functions/vector.lua +3 -3
  323. package/dist/src/functions/weighted.d.ts +12 -1
  324. package/dist/src/functions/weighted.d.ts.map +1 -1
  325. package/dist/src/functions/weighted.lua +27 -10
  326. package/dist/src/index.d.ts +5 -0
  327. package/dist/src/index.d.ts.map +1 -1
  328. package/dist/src/index.lua +24 -0
  329. package/dist/src/interfaces/SaveData.d.ts +3 -7
  330. package/dist/src/interfaces/SaveData.d.ts.map +1 -1
  331. package/dist/src/interfaces/SaveData.lua +0 -11
  332. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +195 -2
  333. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -1
  334. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +1 -1
  335. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
  336. package/dist/src/objects/isaacAPIClassTypeToBrand.lua +1 -1
  337. package/dist/src/types/AnyClass.d.ts +2 -0
  338. package/dist/src/types/AnyClass.d.ts.map +1 -0
  339. package/dist/src/types/AnyClass.lua +2 -0
  340. package/dist/src/types/AnyFunction.d.ts +6 -0
  341. package/dist/src/types/AnyFunction.d.ts.map +1 -0
  342. package/dist/src/types/AnyFunction.lua +2 -0
  343. package/dist/src/types/FunctionTuple.d.ts +2 -4
  344. package/dist/src/types/FunctionTuple.d.ts.map +1 -1
  345. package/dist/src/types/HasFunction.d.ts +5 -0
  346. package/dist/src/types/HasFunction.d.ts.map +1 -0
  347. package/dist/src/types/HasFunction.lua +2 -0
  348. package/package.json +1 -1
  349. package/src/callbacks.ts +88 -5
  350. package/src/classes/ModFeature.ts +96 -6
  351. package/src/classes/ModUpgraded.ts +57 -32
  352. package/src/classes/callbacks/PostCustomRevive.ts +22 -2
  353. package/src/classes/callbacks/PostGridEntityBroken.ts +1 -1
  354. package/src/classes/callbacks/PostGridEntityCollision.ts +1 -1
  355. package/src/classes/callbacks/PostGridEntityCustomBroken.ts +1 -1
  356. package/src/classes/callbacks/PostGridEntityCustomCollision.ts +1 -1
  357. package/src/classes/callbacks/PostGridEntityCustomInit.ts +1 -1
  358. package/src/classes/callbacks/PostGridEntityCustomRemove.ts +1 -1
  359. package/src/classes/callbacks/PostGridEntityCustomRender.ts +11 -0
  360. package/src/classes/callbacks/PostGridEntityCustomStateChanged.ts +1 -1
  361. package/src/classes/callbacks/PostGridEntityCustomUpdate.ts +1 -1
  362. package/src/classes/callbacks/PostGridEntityInit.ts +1 -1
  363. package/src/classes/callbacks/PostGridEntityRemove.ts +1 -1
  364. package/src/classes/callbacks/PostGridEntityRender.ts +11 -0
  365. package/src/classes/callbacks/PostGridEntityStateChanged.ts +1 -1
  366. package/src/classes/callbacks/PostGridEntityUpdate.ts +1 -1
  367. package/src/classes/callbacks/PostHolyMantleRemoved.ts +5 -8
  368. package/src/classes/callbacks/PostItemDischarge.ts +181 -0
  369. package/src/classes/callbacks/PostItemPickup.ts +11 -0
  370. package/src/classes/callbacks/PostLaserInitLate.ts +28 -0
  371. package/src/classes/callbacks/PostNPCInitLate.ts +28 -0
  372. package/src/classes/callbacks/PostNPCStateChanged.ts +37 -0
  373. package/src/classes/callbacks/PostPickupCollect.ts +37 -0
  374. package/src/classes/callbacks/PostPickupInitFirst.ts +34 -0
  375. package/src/classes/callbacks/PostPickupInitLate.ts +28 -0
  376. package/src/classes/callbacks/PostPickupStateChanged.ts +35 -0
  377. package/src/classes/callbacks/PostPitUpdate.ts +21 -0
  378. package/src/classes/callbacks/PostPlayerChangeHealth.ts +57 -0
  379. package/src/classes/callbacks/PostPlayerChangeStat.ts +102 -0
  380. package/src/classes/callbacks/PostPlayerChangeType.ts +44 -0
  381. package/src/classes/callbacks/PostPlayerCollectibleAdded.ts +11 -0
  382. package/src/classes/callbacks/PostPlayerCollectibleRemoved.ts +11 -0
  383. package/src/classes/callbacks/PostPlayerInitFirst.ts +44 -0
  384. package/src/classes/callbacks/PostPlayerInitLate.ts +32 -0
  385. package/src/classes/callbacks/PostPoopRender.ts +21 -0
  386. package/src/classes/callbacks/PostPoopUpdate.ts +21 -0
  387. package/src/classes/callbacks/PostPressurePlateRender.ts +21 -0
  388. package/src/classes/callbacks/PostPressurePlateUpdate.ts +21 -0
  389. package/src/classes/callbacks/PostProjectileInitLate.ts +28 -0
  390. package/src/classes/callbacks/PostPurchase.ts +87 -0
  391. package/src/classes/callbacks/PostRockRender.ts +21 -0
  392. package/src/classes/callbacks/PostRockUpdate.ts +21 -0
  393. package/src/classes/callbacks/PostSacrifice.ts +89 -0
  394. package/src/classes/callbacks/PostSlotAnimationChanged.ts +11 -0
  395. package/src/classes/callbacks/PostSlotCollision.ts +26 -0
  396. package/src/classes/callbacks/PostSlotDestroyed.ts +79 -0
  397. package/src/classes/callbacks/PostSlotInit.ts +11 -0
  398. package/src/classes/callbacks/PostSlotRender.ts +11 -0
  399. package/src/classes/callbacks/PostSlotUpdate.ts +11 -0
  400. package/src/classes/callbacks/PostSpikesUpdate.ts +21 -0
  401. package/src/classes/callbacks/PostTNTRender.ts +21 -0
  402. package/src/classes/callbacks/PostTNTUpdate.ts +21 -0
  403. package/src/classes/callbacks/PostTearInitLate.ts +28 -0
  404. package/src/classes/callbacks/PostTearInitVeryLate.ts +33 -0
  405. package/src/classes/callbacks/PostTransformation.ts +71 -0
  406. package/src/classes/callbacks/PreBerserkDeath.ts +5 -8
  407. package/src/classes/callbacks/PreItemPickup.ts +11 -0
  408. package/src/classes/callbacks/validation/CustomCallbackCollectibleType.ts +32 -0
  409. package/src/classes/callbacks/validation/CustomCallbackItemPickup.ts +48 -0
  410. package/src/classes/callbacks/validation/CustomCallbackLaser.ts +27 -0
  411. package/src/classes/callbacks/validation/CustomCallbackNPC.ts +34 -0
  412. package/src/classes/callbacks/validation/CustomCallbackPickup.ts +41 -0
  413. package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +25 -2
  414. package/src/classes/callbacks/validation/CustomCallbackPoop.ts +28 -0
  415. package/src/classes/callbacks/validation/CustomCallbackPressurePlate.ts +31 -0
  416. package/src/classes/callbacks/validation/CustomCallbackProjectile.ts +28 -0
  417. package/src/classes/callbacks/validation/CustomCallbackRock.ts +30 -0
  418. package/src/classes/callbacks/validation/CustomCallbackSlot.ts +37 -0
  419. package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +4 -4
  420. package/src/classes/callbacks/validation/CustomCallbackTNT.ts +28 -0
  421. package/src/classes/callbacks/validation/CustomCallbackTear.ts +27 -0
  422. package/src/classes/features/callbackLogic/CustomGridEntities.ts +32 -36
  423. package/src/classes/features/callbackLogic/CustomRevive.ts +14 -21
  424. package/src/classes/features/callbackLogic/EsauJrDetection.ts +0 -4
  425. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +7 -9
  426. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +0 -4
  427. package/src/classes/features/callbackLogic/GridEntityRenderDetection.ts +42 -0
  428. package/src/classes/features/callbackLogic/{GridEntityDetection.ts → GridEntityUpdateDetection.ts} +4 -20
  429. package/src/classes/features/callbackLogic/ItemPickupDetection.ts +91 -0
  430. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +245 -0
  431. package/src/classes/features/callbackLogic/SlotRenderDetection.ts +64 -0
  432. package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +57 -0
  433. package/src/classes/features/other/RunInNFrames.ts +7 -0
  434. package/src/classes/features/other/SaveDataManager.ts +492 -0
  435. package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +138 -0
  436. package/src/classes/features/other/saveDataManager/loadFromDisk.ts +99 -0
  437. package/src/classes/features/other/saveDataManager/restoreDefaults.ts +116 -0
  438. package/src/classes/features/other/saveDataManager/saveToDisk.ts +70 -0
  439. package/src/classes/private/CustomCallback.ts +2 -6
  440. package/src/classes/private/Feature.ts +1 -0
  441. package/src/core/upgradeMod.ts +6 -13
  442. package/src/decorators.ts +17 -16
  443. package/src/enums/ISCFeature.ts +44 -39
  444. package/src/enums/ModCallbackCustom.ts +34 -20
  445. package/src/enums/ModCallbackCustom2.ts +53 -5
  446. package/src/enums/{private/SerializationBrand.ts → SerializationBrand.ts} +8 -2
  447. package/src/features/customItemPool.ts +133 -0
  448. package/src/features/deployJSONRoom.ts +6 -4
  449. package/src/features/fadeInRemover.ts +4 -22
  450. package/src/features/saveDataManager/exports.ts +62 -3
  451. package/src/features/saveDataManager/load.ts +4 -1
  452. package/src/features/saveDataManager/main.ts +5 -3
  453. package/src/features/saveDataManager/maps.ts +16 -0
  454. package/src/features.ts +39 -4
  455. package/src/functions/array.ts +8 -9
  456. package/src/functions/bitSet128.ts +3 -3
  457. package/src/functions/color.ts +3 -3
  458. package/src/functions/decorators.ts +83 -12
  459. package/src/functions/deepCopy.ts +83 -17
  460. package/src/functions/deepCopyTests.ts +1 -1
  461. package/src/functions/initArray.ts +6 -11
  462. package/src/functions/jsonRoom.ts +11 -0
  463. package/src/functions/kColor.ts +3 -3
  464. package/src/functions/logMisc.ts +28 -2
  465. package/src/{features/saveDataManager → functions}/merge.ts +79 -45
  466. package/src/functions/mergeTests.ts +2 -3
  467. package/src/functions/rng.ts +3 -3
  468. package/src/functions/serialization.ts +25 -1
  469. package/src/functions/table.ts +1 -1
  470. package/src/functions/tstlClass.ts +3 -57
  471. package/src/functions/vector.ts +3 -3
  472. package/src/functions/weighted.ts +28 -11
  473. package/src/index.ts +5 -0
  474. package/src/interfaces/SaveData.ts +3 -34
  475. package/src/interfaces/private/AddCallbackParametersCustom2.ts +298 -7
  476. package/src/objects/isaacAPIClassTypeToBrand.ts +1 -1
  477. package/src/types/AnyClass.ts +1 -0
  478. package/src/types/AnyFunction.ts +5 -0
  479. package/src/types/FunctionTuple.ts +3 -4
  480. package/src/types/HasFunction.ts +7 -0
  481. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts.map +0 -1
  482. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.lua +0 -19
  483. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts.map +0 -1
  484. package/dist/src/enums/private/SerializationBrand.d.ts.map +0 -1
  485. package/dist/src/features/saveDataManager/merge.d.ts +0 -26
  486. package/dist/src/features/saveDataManager/merge.d.ts.map +0 -1
  487. package/dist/src/features/saveDataManager/serializationBrands.d.ts +0 -2
  488. package/dist/src/features/saveDataManager/serializationBrands.d.ts.map +0 -1
  489. package/dist/src/features/saveDataManager/serializationBrands.lua +0 -19
  490. package/dist/src/indexLua.d.ts +0 -199
  491. package/dist/src/indexLua.d.ts.map +0 -1
  492. package/dist/src/indexLua.lua +0 -1354
  493. package/src/classes/callbacks/validation/CustomCallbackRevive.ts +0 -27
  494. package/src/features/saveDataManager/serializationBrands.ts +0 -16
@@ -9,14 +9,12 @@ local ____exports = {}
9
9
  local deepCopyTable, deepCopyDefaultMap, getNewDefaultMap, deepCopyMap, deepCopySet, deepCopyTSTLClass, deepCopyArray, deepCopyNormalLuaTable, getCopiedEntries, checkMetatable, deepCopyUserdata
10
10
  local ____DefaultMap = require("src.classes.DefaultMap")
11
11
  local DefaultMap = ____DefaultMap.DefaultMap
12
- local ____SerializationBrand = require("src.enums.private.SerializationBrand")
12
+ local ____SerializationBrand = require("src.enums.SerializationBrand")
13
13
  local SerializationBrand = ____SerializationBrand.SerializationBrand
14
14
  local ____SerializationType = require("src.enums.SerializationType")
15
15
  local SerializationType = ____SerializationType.SerializationType
16
16
  local ____constants = require("src.features.saveDataManager.constants")
17
17
  local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
18
- local ____serializationBrands = require("src.features.saveDataManager.serializationBrands")
19
- local isSerializationBrand = ____serializationBrands.isSerializationBrand
20
18
  local ____array = require("src.functions.array")
21
19
  local isArray = ____array.isArray
22
20
  local ____isaacAPIClass = require("src.functions.isaacAPIClass")
@@ -27,6 +25,7 @@ local ____serialization = require("src.functions.serialization")
27
25
  local copyIsaacAPIClass = ____serialization.copyIsaacAPIClass
28
26
  local deserializeIsaacAPIClass = ____serialization.deserializeIsaacAPIClass
29
27
  local isCopyableIsaacAPIClass = ____serialization.isCopyableIsaacAPIClass
28
+ local isSerializationBrand = ____serialization.isSerializationBrand
30
29
  local isSerializedIsaacAPIClass = ____serialization.isSerializedIsaacAPIClass
31
30
  local serializeIsaacAPIClass = ____serialization.serializeIsaacAPIClass
32
31
  local ____tstlClass = require("src.functions.tstlClass")
@@ -34,7 +33,6 @@ local getTSTLClassName = ____tstlClass.getTSTLClassName
34
33
  local isDefaultMap = ____tstlClass.isDefaultMap
35
34
  local isTSTLMap = ____tstlClass.isTSTLMap
36
35
  local isTSTLSet = ____tstlClass.isTSTLSet
37
- local isUserDefinedTSTLClass = ____tstlClass.isUserDefinedTSTLClass
38
36
  local newTSTLClass = ____tstlClass.newTSTLClass
39
37
  local ____types = require("src.functions.types")
40
38
  local asString = ____types.asString
@@ -71,17 +69,25 @@ local twoDimensionalSort = ____utils.twoDimensionalSort
71
69
  -- @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
72
70
  -- serialize objects to Lua tables, or can deserialize Lua tables to
73
71
  -- objects. Default is `SerializationType.NONE`.
74
- -- @param traversalDescription Optional. Used to track the current key that we are operating on.
75
- -- Default is an empty string.
72
+ -- @param traversalDescription Optional. Used to track the current key that we are operating on for
73
+ -- debugging purposes. Default is an empty string.
74
+ -- @param classConstructors Optional. A Lua table that maps the name of a user-defined TSTL class to
75
+ -- its corresponding constructor. If the `deepCopy` function finds any
76
+ -- user-defined TSTL classes when recursively iterating through the given
77
+ -- object, it will use this map to instantiate a new class. Default is an
78
+ -- empty Lua table.
76
79
  -- @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
77
80
  -- recursively copying a TSTL Map. Default is false.
78
- function ____exports.deepCopy(self, value, serializationType, traversalDescription, insideMap)
81
+ function ____exports.deepCopy(self, value, serializationType, traversalDescription, classConstructors, insideMap)
79
82
  if serializationType == nil then
80
83
  serializationType = SerializationType.NONE
81
84
  end
82
85
  if traversalDescription == nil then
83
86
  traversalDescription = ""
84
87
  end
88
+ if classConstructors == nil then
89
+ classConstructors = {}
90
+ end
85
91
  if insideMap == nil then
86
92
  insideMap = false
87
93
  end
@@ -125,6 +131,7 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
125
131
  luaMap,
126
132
  serializationType,
127
133
  traversalDescription,
134
+ classConstructors,
128
135
  insideMap
129
136
  )
130
137
  end
@@ -137,13 +144,14 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
137
144
  end
138
145
  until true
139
146
  end
140
- function deepCopyTable(self, luaMap, serializationType, traversalDescription, insideMap)
147
+ function deepCopyTable(self, luaMap, serializationType, traversalDescription, classConstructors, insideMap)
141
148
  if isDefaultMap(nil, luaMap) or luaMap[SerializationBrand.DEFAULT_MAP] ~= nil then
142
149
  return deepCopyDefaultMap(
143
150
  nil,
144
151
  luaMap,
145
152
  serializationType,
146
153
  traversalDescription,
154
+ classConstructors,
147
155
  insideMap
148
156
  )
149
157
  end
@@ -153,6 +161,7 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, in
153
161
  luaMap,
154
162
  serializationType,
155
163
  traversalDescription,
164
+ classConstructors,
156
165
  insideMap
157
166
  )
158
167
  end
@@ -162,6 +171,7 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, in
162
171
  luaMap,
163
172
  serializationType,
164
173
  traversalDescription,
174
+ classConstructors,
165
175
  insideMap
166
176
  )
167
177
  end
@@ -172,12 +182,13 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, in
172
182
  if className == "WeakSet" then
173
183
  error("The deep copy function does not support copying the \"WeakSet\" class for: " .. traversalDescription)
174
184
  end
175
- if isUserDefinedTSTLClass(nil, luaMap) then
185
+ if className ~= nil or luaMap[SerializationBrand.TSTL_CLASS] ~= nil then
176
186
  return deepCopyTSTLClass(
177
187
  nil,
178
188
  luaMap,
179
189
  serializationType,
180
190
  traversalDescription,
191
+ classConstructors,
181
192
  insideMap
182
193
  )
183
194
  end
@@ -191,6 +202,7 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, in
191
202
  luaMap,
192
203
  serializationType,
193
204
  traversalDescription,
205
+ classConstructors,
194
206
  insideMap
195
207
  )
196
208
  end
@@ -199,10 +211,11 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, in
199
211
  luaMap,
200
212
  serializationType,
201
213
  traversalDescription,
214
+ classConstructors,
202
215
  insideMap
203
216
  )
204
217
  end
205
- function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription, insideMap)
218
+ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription, classConstructors, insideMap)
206
219
  if SAVE_DATA_MANAGER_DEBUG then
207
220
  log(nil, "deepCopy is copying a DefaultMap.")
208
221
  end
@@ -222,6 +235,7 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
222
235
  defaultMap,
223
236
  serializationType,
224
237
  traversalDescription,
238
+ classConstructors,
225
239
  insideMap
226
240
  )
227
241
  end
@@ -239,6 +253,7 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
239
253
  defaultMap,
240
254
  serializationType,
241
255
  traversalDescription,
256
+ classConstructors,
242
257
  insideMap
243
258
  )
244
259
  local entries = ____getCopiedEntries_result_1.entries
@@ -284,18 +299,18 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
284
299
  if ____cond35 then
285
300
  do
286
301
  if isDefaultMap(nil, defaultMap) then
287
- error(("The deep copy function failed to deserialize a default map of \"" .. traversalDescription) .. "\", since it was not a Lua table.")
302
+ error(("Failed to deserialize a default map of \"" .. traversalDescription) .. "\", since it was not a Lua table.")
288
303
  end
289
304
  local defaultMapValue = defaultMap[SerializationBrand.DEFAULT_MAP_VALUE]
290
305
  if defaultMapValue == nil then
291
- error((("The deep copy function failed to deserialize a default map of \"" .. traversalDescription) .. "\", since there was no serialization brand of: ") .. SerializationBrand.DEFAULT_MAP_VALUE)
306
+ error((("Failed to deserialize a default map of \"" .. traversalDescription) .. "\", since there was no serialization brand of: ") .. SerializationBrand.DEFAULT_MAP_VALUE)
292
307
  end
293
308
  return __TS__New(DefaultMap, defaultMapValue)
294
309
  end
295
310
  end
296
311
  until true
297
312
  end
298
- function deepCopyMap(self, map, serializationType, traversalDescription, insideMap)
313
+ function deepCopyMap(self, map, serializationType, traversalDescription, classConstructors, insideMap)
299
314
  if SAVE_DATA_MANAGER_DEBUG then
300
315
  log(nil, "deepCopy is copying a Map.")
301
316
  end
@@ -312,6 +327,7 @@ function deepCopyMap(self, map, serializationType, traversalDescription, insideM
312
327
  map,
313
328
  serializationType,
314
329
  traversalDescription,
330
+ classConstructors,
315
331
  insideMap
316
332
  )
317
333
  local entries = ____getCopiedEntries_result_2.entries
@@ -335,7 +351,7 @@ function deepCopyMap(self, map, serializationType, traversalDescription, insideM
335
351
  insideMap = false
336
352
  return newMap
337
353
  end
338
- function deepCopySet(self, set, serializationType, traversalDescription, insideMap)
354
+ function deepCopySet(self, set, serializationType, traversalDescription, classConstructors, insideMap)
339
355
  if SAVE_DATA_MANAGER_DEBUG then
340
356
  log(nil, "deepCopy is copying a Set.")
341
357
  end
@@ -351,6 +367,7 @@ function deepCopySet(self, set, serializationType, traversalDescription, insideM
351
367
  set,
352
368
  serializationType,
353
369
  traversalDescription,
370
+ classConstructors,
354
371
  insideMap
355
372
  )
356
373
  local entries = ____getCopiedEntries_result_3.entries
@@ -372,21 +389,53 @@ function deepCopySet(self, set, serializationType, traversalDescription, insideM
372
389
  end
373
390
  return newSet
374
391
  end
375
- function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription, insideMap)
392
+ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription, classConstructors, insideMap)
376
393
  if SAVE_DATA_MANAGER_DEBUG then
377
394
  log(nil, "deepCopy is copying a TSTL class.")
378
395
  end
379
396
  local newClass
380
- if serializationType == SerializationType.SERIALIZE then
381
- newClass = {}
382
- else
383
- newClass = newTSTLClass(nil, tstlClass)
384
- end
397
+ repeat
398
+ local ____switch65 = serializationType
399
+ local ____cond65 = ____switch65 == SerializationType.NONE
400
+ if ____cond65 then
401
+ do
402
+ newClass = newTSTLClass(nil, tstlClass)
403
+ break
404
+ end
405
+ end
406
+ ____cond65 = ____cond65 or ____switch65 == SerializationType.SERIALIZE
407
+ if ____cond65 then
408
+ do
409
+ newClass = {}
410
+ local tstlClassName = getTSTLClassName(nil, tstlClass)
411
+ if tstlClassName ~= nil then
412
+ newClass[SerializationBrand.TSTL_CLASS] = tstlClassName
413
+ end
414
+ break
415
+ end
416
+ end
417
+ ____cond65 = ____cond65 or ____switch65 == SerializationType.DESERIALIZE
418
+ if ____cond65 then
419
+ do
420
+ local tstlClassName = tstlClass[SerializationBrand.TSTL_CLASS]
421
+ if tstlClassName == nil then
422
+ error("Failed to deserialize a TSTL class since the brand did not contain the class name.")
423
+ end
424
+ local classConstructor = classConstructors[tstlClassName]
425
+ if classConstructor == nil then
426
+ error(("Failed to deserialize a TSTL class since there was no constructor registered for a class name of \"" .. tstlClassName) .. "\". If this mod is using the save data manager, it must register the class constructor with the \"saveDataManagerRegisterClass\" method.")
427
+ end
428
+ newClass = __TS__New(classConstructor)
429
+ end
430
+ break
431
+ end
432
+ until true
385
433
  local ____getCopiedEntries_result_4 = getCopiedEntries(
386
434
  nil,
387
435
  tstlClass,
388
436
  serializationType,
389
437
  traversalDescription,
438
+ classConstructors,
390
439
  insideMap
391
440
  )
392
441
  local entries = ____getCopiedEntries_result_4.entries
@@ -401,7 +450,7 @@ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescript
401
450
  end
402
451
  return newClass
403
452
  end
404
- function deepCopyArray(self, array, serializationType, traversalDescription, insideMap)
453
+ function deepCopyArray(self, array, serializationType, traversalDescription, classConstructors, insideMap)
405
454
  if SAVE_DATA_MANAGER_DEBUG then
406
455
  log(nil, "deepCopy is copying an array.")
407
456
  end
@@ -412,13 +461,14 @@ function deepCopyArray(self, array, serializationType, traversalDescription, ins
412
461
  value,
413
462
  serializationType,
414
463
  traversalDescription,
464
+ classConstructors,
415
465
  insideMap
416
466
  )
417
467
  newArray[#newArray + 1] = newValue
418
468
  end
419
469
  return newArray
420
470
  end
421
- function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescription, insideMap)
471
+ function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescription, classConstructors, insideMap)
422
472
  if SAVE_DATA_MANAGER_DEBUG then
423
473
  log(nil, "deepCopy is copying a normal Lua table.")
424
474
  end
@@ -428,6 +478,7 @@ function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescri
428
478
  luaMap,
429
479
  serializationType,
430
480
  traversalDescription,
481
+ classConstructors,
431
482
  insideMap
432
483
  )
433
484
  local entries = ____getCopiedEntries_result_5.entries
@@ -442,7 +493,7 @@ function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescri
442
493
  end
443
494
  return newTable
444
495
  end
445
- function getCopiedEntries(self, object, serializationType, traversalDescription, insideMap)
496
+ function getCopiedEntries(self, object, serializationType, traversalDescription, classConstructors, insideMap)
446
497
  local entries = {}
447
498
  if isTSTLMap(nil, object) or isTSTLSet(nil, object) or isDefaultMap(nil, object) then
448
499
  for ____, ____value in __TS__Iterator(object:entries()) do
@@ -481,7 +532,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
481
532
  local value = ____value[2]
482
533
  do
483
534
  if isSerializationBrand(nil, key) then
484
- goto __continue88
535
+ goto __continue93
485
536
  end
486
537
  traversalDescription = getTraversalDescription(nil, key, traversalDescription)
487
538
  local newValue = ____exports.deepCopy(
@@ -489,6 +540,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
489
540
  value,
490
541
  serializationType,
491
542
  traversalDescription,
543
+ classConstructors,
492
544
  insideMap
493
545
  )
494
546
  local keyToUse = key
@@ -503,7 +555,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
503
555
  end
504
556
  copiedEntries[#copiedEntries + 1] = {keyToUse, newValue}
505
557
  end
506
- ::__continue88::
558
+ ::__continue93::
507
559
  end
508
560
  return {entries = copiedEntries, convertedNumberKeysToStrings = convertNumberKeysToStrings}
509
561
  end
@@ -524,21 +576,21 @@ function deepCopyUserdata(self, value, serializationType, traversalDescription)
524
576
  error((("The deep copy function does not support serializing \"" .. traversalDescription) .. "\", since it is an Isaac API class of type: ") .. classType)
525
577
  end
526
578
  repeat
527
- local ____switch99 = serializationType
528
- local ____cond99 = ____switch99 == SerializationType.NONE
529
- if ____cond99 then
579
+ local ____switch104 = serializationType
580
+ local ____cond104 = ____switch104 == SerializationType.NONE
581
+ if ____cond104 then
530
582
  do
531
583
  return copyIsaacAPIClass(nil, value)
532
584
  end
533
585
  end
534
- ____cond99 = ____cond99 or ____switch99 == SerializationType.SERIALIZE
535
- if ____cond99 then
586
+ ____cond104 = ____cond104 or ____switch104 == SerializationType.SERIALIZE
587
+ if ____cond104 then
536
588
  do
537
589
  return serializeIsaacAPIClass(nil, value)
538
590
  end
539
591
  end
540
- ____cond99 = ____cond99 or ____switch99 == SerializationType.DESERIALIZE
541
- if ____cond99 then
592
+ ____cond104 = ____cond104 or ____switch104 == SerializationType.DESERIALIZE
593
+ if ____cond104 then
542
594
  do
543
595
  error(("The deep copy function can not deserialize \"" .. traversalDescription) .. "\", since it is userdata.")
544
596
  end
@@ -7,7 +7,7 @@ local ____exports = {}
7
7
  local copiedObjectIsTable, copiedObjectHasKeyAndValueString, copiedTableHasKeyAndValueNumber, copiedTableDoesNotCoerceTypes, copiedObjectHasNoReferencesForPrimitivesForward, copiedObjectHasNoReferencesForPrimitivesBackward, copiedObjectHasNoReferencesForArray, copiedObjectHasChildObject, copiedMapIsMap, copiedMapHasValue, copiedSetIsSet, copiedSetHasValue, copiedMapHasChildMap, copiedDefaultMapHasChildDefaultMap, copiedDefaultMapHasBrand, copiedSerializedMapHasStringKey, copiedSerializedMapHasNumberKey, copiedSerializedDefaultMapHasStringKey, copiedSerializedDefaultMapHasNumberKey
8
8
  local ____DefaultMap = require("src.classes.DefaultMap")
9
9
  local DefaultMap = ____DefaultMap.DefaultMap
10
- local ____SerializationBrand = require("src.enums.private.SerializationBrand")
10
+ local ____SerializationBrand = require("src.enums.SerializationBrand")
11
11
  local SerializationBrand = ____SerializationBrand.SerializationBrand
12
12
  local ____SerializationType = require("src.enums.SerializationType")
13
13
  local SerializationType = ____SerializationType.SerializationType
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Initializes an array with all of the elements containing the specified default value.
4
4
  *
5
- * If the provided default value is not a boolean, number, or string, then it will be copied with
6
- * the `deepCopy` function before adding it to the new array. In this way, you can initialize an
7
- * array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
8
- * all of the array elements would just be references to the same underlying data structure.)
5
+ * The provided default value will be copied with the `deepCopy` function before adding it to the
6
+ * new array. Thus, you can initialize an array of arrays, or an array of maps, and so on. (If the
7
+ * `deepCopy` function was not used, then all of the array elements would just be references to the
8
+ * same underlying data structure.)
9
9
  *
10
10
  * For example:
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"initArray.d.ts","sourceRoot":"","sources":["../../../src/functions/initArray.ts"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,CAY5D"}
1
+ {"version":3,"file":"initArray.d.ts","sourceRoot":"","sources":["../../../src/functions/initArray.ts"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,CAQ5D"}
@@ -1,16 +1,14 @@
1
1
  local ____exports = {}
2
2
  local ____deepCopy = require("src.functions.deepCopy")
3
3
  local deepCopy = ____deepCopy.deepCopy
4
- local ____types = require("src.functions.types")
5
- local isPrimitive = ____types.isPrimitive
6
4
  local ____utils = require("src.functions.utils")
7
5
  local ____repeat = ____utils["repeat"]
8
6
  --- Initializes an array with all of the elements containing the specified default value.
9
7
  --
10
- -- If the provided default value is not a boolean, number, or string, then it will be copied with
11
- -- the `deepCopy` function before adding it to the new array. In this way, you can initialize an
12
- -- array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
13
- -- all of the array elements would just be references to the same underlying data structure.)
8
+ -- The provided default value will be copied with the `deepCopy` function before adding it to the
9
+ -- new array. Thus, you can initialize an array of arrays, or an array of maps, and so on. (If the
10
+ -- `deepCopy` function was not used, then all of the array elements would just be references to the
11
+ -- same underlying data structure.)
14
12
  --
15
13
  -- For example:
16
14
  --
@@ -24,12 +22,8 @@ function ____exports.initArray(self, defaultValue, size)
24
22
  nil,
25
23
  size,
26
24
  function()
27
- if isPrimitive(nil, defaultValue) then
28
- array[#array + 1] = defaultValue
29
- else
30
- local copy = deepCopy(nil, defaultValue)
31
- array[#array + 1] = copy
32
- end
25
+ local copy = deepCopy(nil, defaultValue)
26
+ array[#array + 1] = copy
33
27
  end
34
28
  )
35
29
  return array
@@ -3,11 +3,15 @@ import { JSONEntity, JSONRoom } from "../interfaces/JSONRoomsFile";
3
3
  /**
4
4
  * Helper function to calculate what the resulting `BitFlags<DoorSlotFlag>` value would be for a
5
5
  * given JSON room.
6
+ *
7
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
6
8
  */
7
9
  export declare function getJSONRoomDoorSlotFlags(jsonRoom: JSONRoom): BitFlags<DoorSlotFlag>;
8
10
  /**
9
11
  * Helper function to find a specific room from an array of JSON rooms.
10
12
  *
13
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
14
+ *
11
15
  * @param jsonRooms The array of rooms to search through.
12
16
  * @param variant The room variant to select. (The room variant can be thought of as the ID of the
13
17
  * room.)
@@ -16,6 +20,8 @@ export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[] | readonly JS
16
20
  /**
17
21
  * Helper function to find all of the JSON rooms that match the sub-type provided.
18
22
  *
23
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
24
+ *
19
25
  * @param jsonRooms The array of rooms to search through.
20
26
  * @param subType The sub-type to match.
21
27
  */
@@ -23,6 +29,9 @@ export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[] | readonly J
23
29
  /**
24
30
  * Helper function to get a random JSON entity from an array of JSON entities.
25
31
  *
32
+ * (A JSON entity is an entity inside of a JSON room. A JSON room is an XML file converted to JSON
33
+ * so that it can be directly imported into your mod.)
34
+ *
26
35
  * Note that this function does not simply choose a random element in the provided array; it will
27
36
  * properly account for each room weight using the algorithm from:
28
37
  * https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -37,6 +46,8 @@ export declare function getRandomJSONEntity(jsonEntities: JSONEntity[], seedOrRN
37
46
  /**
38
47
  * Helper function to get a random JSON room from an array of JSON rooms.
39
48
  *
49
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
50
+ *
40
51
  * Note that this function does not simply choose a random element in the provided array; it will
41
52
  * properly account for each room weight using the algorithm from:
42
53
  * https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -1 +1 @@
1
- {"version":3,"file":"jsonRoom.d.ts","sourceRoot":"","sources":["../../../src/functions/jsonRoom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAanE;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,YAAY,CAAC,CAgDxB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,OAAO,EAAE,GAAG,GACX,QAAQ,GAAG,SAAS,CAoBtB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,OAAO,EAAE,GAAG,GACX,QAAQ,EAAE,CAMZ;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,UAAU,EAAE,EAC1B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,UAAU,CAoBZ;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,QAAQ,CAiBV"}
1
+ {"version":3,"file":"jsonRoom.d.ts","sourceRoot":"","sources":["../../../src/functions/jsonRoom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAanE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,YAAY,CAAC,CAgDxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,OAAO,EAAE,GAAG,GACX,QAAQ,GAAG,SAAS,CAoBtB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,OAAO,EAAE,GAAG,GACX,QAAQ,EAAE,CAMZ;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,UAAU,EAAE,EAC1B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,UAAU,CAoBZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,QAAQ,CAiBV"}
@@ -49,6 +49,8 @@ function getJSONObjectWithChosenWeight(self, jsonOjectArray, chosenWeight)
49
49
  end
50
50
  --- Helper function to calculate what the resulting `BitFlags<DoorSlotFlag>` value would be for a
51
51
  -- given JSON room.
52
+ --
53
+ -- (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
52
54
  function ____exports.getJSONRoomDoorSlotFlags(self, jsonRoom)
53
55
  local roomShapeString = jsonRoom["$"].shape
54
56
  local roomShapeNumber = tonumber(roomShapeString)
@@ -89,6 +91,8 @@ function ____exports.getJSONRoomDoorSlotFlags(self, jsonRoom)
89
91
  end
90
92
  --- Helper function to find a specific room from an array of JSON rooms.
91
93
  --
94
+ -- (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
95
+ --
92
96
  -- @param jsonRooms The array of rooms to search through.
93
97
  -- @param variant The room variant to select. (The room variant can be thought of as the ID of the
94
98
  -- room.)
@@ -111,6 +115,8 @@ function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
111
115
  end
112
116
  --- Helper function to find all of the JSON rooms that match the sub-type provided.
113
117
  --
118
+ -- (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
119
+ --
114
120
  -- @param jsonRooms The array of rooms to search through.
115
121
  -- @param subType The sub-type to match.
116
122
  function ____exports.getJSONRoomsOfSubType(self, jsonRooms, subType)
@@ -125,6 +131,9 @@ function ____exports.getJSONRoomsOfSubType(self, jsonRooms, subType)
125
131
  end
126
132
  --- Helper function to get a random JSON entity from an array of JSON entities.
127
133
  --
134
+ -- (A JSON entity is an entity inside of a JSON room. A JSON room is an XML file converted to JSON
135
+ -- so that it can be directly imported into your mod.)
136
+ --
128
137
  -- Note that this function does not simply choose a random element in the provided array; it will
129
138
  -- properly account for each room weight using the algorithm from:
130
139
  -- https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -163,6 +172,8 @@ function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
163
172
  end
164
173
  --- Helper function to get a random JSON room from an array of JSON rooms.
165
174
  --
175
+ -- (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
176
+ --
166
177
  -- Note that this function does not simply choose a random element in the provided array; it will
167
178
  -- properly account for each room weight using the algorithm from:
168
179
  -- https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -22,8 +22,8 @@ export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number):
22
22
  /** Helper function to check if something is an instantiated `KColor` object. */
23
23
  export declare function isKColor(object: unknown): object is KColor;
24
24
  /**
25
- * Used to determine is the given table is a serialized `KColor` object created by the save data
26
- * manager and/or the `deepCopy` function.
25
+ * Used to determine is the given table is a serialized `KColor` object created by the `deepCopy`
26
+ * function.
27
27
  */
28
28
  export declare function isSerializedKColor(object: unknown): object is SerializedKColor;
29
29
  export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean;
@@ -1,6 +1,6 @@
1
1
  local ____exports = {}
2
2
  local OBJECT_NAME
3
- local ____SerializationBrand = require("src.enums.private.SerializationBrand")
3
+ local ____SerializationBrand = require("src.enums.SerializationBrand")
4
4
  local SerializationBrand = ____SerializationBrand.SerializationBrand
5
5
  local ____isaacAPIClass = require("src.functions.isaacAPIClass")
6
6
  local isaacAPIClassEquals = ____isaacAPIClass.isaacAPIClassEquals
@@ -74,8 +74,8 @@ function ____exports.getRandomKColor(self, seedOrRNG, alpha)
74
74
  local b = getRandom(nil, rng)
75
75
  return KColor(r, g, b, alpha)
76
76
  end
77
- --- Used to determine is the given table is a serialized `KColor` object created by the save data
78
- -- manager and/or the `deepCopy` function.
77
+ --- Used to determine is the given table is a serialized `KColor` object created by the `deepCopy`
78
+ -- function.
79
79
  function ____exports.isSerializedKColor(self, object)
80
80
  if not isTable(nil, object) then
81
81
  return false
@@ -44,8 +44,8 @@ export declare function logSet(set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>): vo
44
44
  /** Helper function for logging every sound effect that is currently playing. */
45
45
  export declare function logSounds(): void;
46
46
  /**
47
- * Helper function for logging every key and value of a table. This is a deep log; the function will
48
- * recursively call itself if it counters a table within a table.
47
+ * Helper function for logging every key and value of a Lua table. This is a deep log; the function
48
+ * will recursively call itself if it counters a table within a table.
49
49
  *
50
50
  * This function will only work on tables that have string keys (because it logs the keys in order,
51
51
  * instead of randomly). It will throw a run-time error if it encounters a non-string key.
@@ -56,6 +56,13 @@ export declare function logTable(luaTable: unknown, parentTables?: number): void
56
56
  * will only do a shallow comparison.
57
57
  */
58
58
  export declare function logTableDifferences<K extends AnyNotNil, V>(table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
59
+ /**
60
+ * Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the
61
+ * top-most table will be logged.
62
+ *
63
+ * This function is useful for tables that have recursive references.
64
+ */
65
+ export declare function logTableKeys(luaTable: unknown): void;
59
66
  /** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
60
67
  export declare function logTearFlags(flags: TearFlag | BitFlags<TearFlag>): void;
61
68
  /** Helper function for printing out every use flag that is turned on. Useful when debugging. */
@@ -1 +1 @@
1
- {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":"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"}
@@ -374,8 +374,8 @@ function ____exports.logSounds(self)
374
374
  end
375
375
  end
376
376
  end
377
- --- Helper function for logging every key and value of a table. This is a deep log; the function will
378
- -- recursively call itself if it counters a table within a table.
377
+ --- Helper function for logging every key and value of a Lua table. This is a deep log; the function
378
+ -- will recursively call itself if it counters a table within a table.
379
379
  --
380
380
  -- This function will only work on tables that have string keys (because it logs the keys in order,
381
381
  -- instead of randomly). It will throw a run-time error if it encounters a non-string key.
@@ -460,6 +460,36 @@ function ____exports.logTableDifferences(self, table1, table2)
460
460
  end
461
461
  end
462
462
  end
463
+ --- Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the
464
+ -- top-most table will be logged.
465
+ --
466
+ -- This function is useful for tables that have recursive references.
467
+ function ____exports.logTableKeys(self, luaTable)
468
+ log(nil, "Printing out the keys of a Lua table:")
469
+ if not isTable(nil, luaTable) then
470
+ log(
471
+ nil,
472
+ (" n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)"
473
+ )
474
+ return
475
+ end
476
+ local numElements = 0
477
+ iterateTableInOrder(
478
+ nil,
479
+ luaTable,
480
+ function(____, key)
481
+ log(
482
+ nil,
483
+ tostring(key)
484
+ )
485
+ numElements = numElements + 1
486
+ end
487
+ )
488
+ log(
489
+ nil,
490
+ " The size of the table was: " .. tostring(numElements)
491
+ )
492
+ end
463
493
  --- Helper function for printing out every tear flag that is turned on. Useful when debugging.
464
494
  function ____exports.logTearFlags(self, flags)
465
495
  ____exports.logFlags(nil, flags, TearFlag, "tear")