isaacscript-common 9.20.0 → 10.0.2
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.
- package/dist/index.d.ts +73 -24
- package/dist/isaacscript-common.lua +253 -138
- package/dist/lualib_bundle.lua +53 -37
- package/dist/package.lua +2 -2
- package/dist/src/features/deployJSONRoom.d.ts +16 -6
- package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/src/features/deployJSONRoom.lua +16 -6
- package/dist/src/features/saveDataManager/load.d.ts +1 -1
- package/dist/src/features/saveDataManager/maps.d.ts +1 -1
- package/dist/src/features/saveDataManager/merge.d.ts +1 -1
- package/dist/src/features/saveDataManager/save.d.ts +1 -1
- package/dist/src/functions/bitSet128.d.ts +3 -2
- package/dist/src/functions/bitSet128.d.ts.map +1 -1
- package/dist/src/functions/bitSet128.lua +2 -2
- package/dist/src/functions/color.d.ts +3 -4
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/color.lua +2 -2
- package/dist/src/functions/curses.d.ts +1 -1
- package/dist/src/functions/curses.lua +1 -1
- package/dist/src/functions/deepCopy.d.ts +2 -1
- package/dist/src/functions/deepCopy.d.ts.map +1 -1
- package/dist/src/functions/deepCopy.lua +19 -25
- package/dist/src/functions/deepCopyTests.lua +13 -26
- package/dist/src/functions/entities.d.ts +1 -1
- package/dist/src/functions/globals.d.ts +1 -1
- package/dist/src/functions/jsonHelpers.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts +3 -4
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/kColor.lua +2 -2
- package/dist/src/functions/log.d.ts +2 -2
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/positionVelocity.d.ts +2 -0
- package/dist/src/functions/positionVelocity.d.ts.map +1 -1
- package/dist/src/functions/positionVelocity.lua +2 -0
- package/dist/src/functions/rng.d.ts +3 -3
- package/dist/src/functions/rng.d.ts.map +1 -1
- package/dist/src/functions/serialization.d.ts +11 -4
- package/dist/src/functions/serialization.d.ts.map +1 -1
- package/dist/src/functions/serialization.lua +15 -0
- package/dist/src/functions/table.d.ts +4 -4
- package/dist/src/functions/table.d.ts.map +1 -1
- package/dist/src/functions/table.lua +8 -4
- package/dist/src/functions/tstlClass.d.ts +1 -1
- package/dist/src/functions/types.d.ts +1 -1
- package/dist/src/functions/vector.d.ts +3 -2
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +2 -2
- package/dist/src/functions/weighted.d.ts +6 -0
- package/dist/src/functions/weighted.d.ts.map +1 -0
- package/dist/src/functions/weighted.lua +35 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/dist/src/interfaces/SaveData.d.ts +3 -8
- package/dist/src/interfaces/SaveData.d.ts.map +1 -1
- package/dist/src/interfaces/private/TSTLClassMetatable.d.ts +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.lua +2 -2
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts +36 -8
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToFunctions.lua +42 -7
- package/dist/src/types/TSTLClass.d.ts +1 -1
- package/dist/src/types/WeightedArray.d.ts +4 -0
- package/dist/src/types/WeightedArray.d.ts.map +1 -0
- package/dist/src/types/{SerializedIsaacAPIClass.lua → WeightedArray.lua} +0 -0
- package/package.json +2 -2
- package/src/features/deployJSONRoom.ts +16 -6
- package/src/features/saveDataManager/exports.ts +1 -1
- package/src/functions/bitSet128.ts +8 -2
- package/src/functions/color.ts +8 -2
- package/src/functions/curses.ts +1 -1
- package/src/functions/deepCopy.ts +25 -15
- package/src/functions/deepCopyTests.ts +19 -41
- package/src/functions/initArray.ts +1 -1
- package/src/functions/kColor.ts +8 -2
- package/src/functions/log.ts +8 -6
- package/src/functions/positionVelocity.ts +2 -0
- package/src/functions/rng.ts +2 -0
- package/src/functions/serialization.ts +72 -18
- package/src/functions/table.ts +15 -6
- package/src/functions/vector.ts +11 -3
- package/src/functions/weighted.ts +36 -0
- package/src/index.ts +2 -1
- package/src/interfaces/SaveData.ts +4 -3
- package/src/objects/isaacAPIClassTypeToBrand.ts +1 -1
- package/src/objects/isaacAPIClassTypeToFunctions.ts +58 -9
- package/src/types/WeightedArray.ts +2 -0
- package/dist/src/enums/private/CopyableIsaacAPIClassType.d.ts +0 -12
- package/dist/src/enums/private/CopyableIsaacAPIClassType.d.ts.map +0 -1
- package/dist/src/enums/private/CopyableIsaacAPIClassType.lua +0 -10
- package/dist/src/types/SerializedIsaacAPIClass.d.ts +0 -11
- package/dist/src/types/SerializedIsaacAPIClass.d.ts.map +0 -1
- package/src/enums/private/CopyableIsaacAPIClassType.ts +0 -11
- package/src/types/SerializedIsaacAPIClass.ts +0 -9
package/dist/lualib_bundle.lua
CHANGED
|
@@ -255,11 +255,15 @@ local function __TS__ArrayPushArray(self, items)
|
|
|
255
255
|
return len
|
|
256
256
|
end
|
|
257
257
|
|
|
258
|
+
local function __TS__CountVarargs(...)
|
|
259
|
+
return select("#", ...)
|
|
260
|
+
end
|
|
261
|
+
|
|
258
262
|
local function __TS__ArrayReduce(self, callbackFn, ...)
|
|
259
263
|
local len = #self
|
|
260
264
|
local k = 0
|
|
261
265
|
local accumulator = nil
|
|
262
|
-
if
|
|
266
|
+
if __TS__CountVarargs(...) ~= 0 then
|
|
263
267
|
accumulator = ...
|
|
264
268
|
elseif len > 0 then
|
|
265
269
|
accumulator = self[1]
|
|
@@ -283,7 +287,7 @@ local function __TS__ArrayReduceRight(self, callbackFn, ...)
|
|
|
283
287
|
local len = #self
|
|
284
288
|
local k = len - 1
|
|
285
289
|
local accumulator = nil
|
|
286
|
-
if
|
|
290
|
+
if __TS__CountVarargs(...) ~= 0 then
|
|
287
291
|
accumulator = ...
|
|
288
292
|
elseif len > 0 then
|
|
289
293
|
accumulator = self[k + 1]
|
|
@@ -399,7 +403,7 @@ end
|
|
|
399
403
|
local function __TS__ArraySplice(self, ...)
|
|
400
404
|
local args = {...}
|
|
401
405
|
local len = #self
|
|
402
|
-
local actualArgumentCount =
|
|
406
|
+
local actualArgumentCount = __TS__CountVarargs(...)
|
|
403
407
|
local start = args[1]
|
|
404
408
|
local deleteCount = args[2]
|
|
405
409
|
if start < 0 then
|
|
@@ -1016,6 +1020,16 @@ local function __TS__DecorateParam(paramIndex, decorator)
|
|
|
1016
1020
|
return function(____, target, key) return decorator(nil, target, key, paramIndex) end
|
|
1017
1021
|
end
|
|
1018
1022
|
|
|
1023
|
+
local function __TS__StringIncludes(self, searchString, position)
|
|
1024
|
+
if not position then
|
|
1025
|
+
position = 1
|
|
1026
|
+
else
|
|
1027
|
+
position = position + 1
|
|
1028
|
+
end
|
|
1029
|
+
local index = string.find(self, searchString, position, true)
|
|
1030
|
+
return index ~= nil
|
|
1031
|
+
end
|
|
1032
|
+
|
|
1019
1033
|
local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
|
|
1020
1034
|
do
|
|
1021
1035
|
local function getErrorStack(self, constructor)
|
|
@@ -1030,13 +1044,18 @@ do
|
|
|
1030
1044
|
break
|
|
1031
1045
|
end
|
|
1032
1046
|
end
|
|
1033
|
-
|
|
1047
|
+
if __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
1048
|
+
return debug.traceback(("[Level " .. tostring(level)) .. "]")
|
|
1049
|
+
else
|
|
1050
|
+
return debug.traceback(nil, level)
|
|
1051
|
+
end
|
|
1034
1052
|
end
|
|
1035
1053
|
local function wrapErrorToString(self, getDescription)
|
|
1036
1054
|
return function(self)
|
|
1037
1055
|
local description = getDescription(self)
|
|
1038
1056
|
local caller = debug.getinfo(3, "f")
|
|
1039
|
-
|
|
1057
|
+
local isClassicLua = __TS__StringIncludes(_VERSION, "Lua 5.0") or _VERSION == "Lua 5.1"
|
|
1058
|
+
if isClassicLua or caller and caller.func ~= error then
|
|
1040
1059
|
return description
|
|
1041
1060
|
else
|
|
1042
1061
|
return (tostring(description) .. "\n") .. self.stack
|
|
@@ -1185,16 +1204,9 @@ do
|
|
|
1185
1204
|
function __TS__Generator(fn)
|
|
1186
1205
|
return function(...)
|
|
1187
1206
|
local args = {...}
|
|
1188
|
-
local argsLength =
|
|
1207
|
+
local argsLength = __TS__CountVarargs(...)
|
|
1189
1208
|
return {
|
|
1190
|
-
____coroutine = coroutine.create(function()
|
|
1191
|
-
local ____fn_1 = fn
|
|
1192
|
-
local ____unpack_0 = unpack
|
|
1193
|
-
if ____unpack_0 == nil then
|
|
1194
|
-
____unpack_0 = table.unpack
|
|
1195
|
-
end
|
|
1196
|
-
return ____fn_1(____unpack_0(args, 1, argsLength))
|
|
1197
|
-
end),
|
|
1209
|
+
____coroutine = coroutine.create(function() return fn(__TS__Unpack(args, 1, argsLength)) end),
|
|
1198
1210
|
[Symbol.iterator] = generatorIterator,
|
|
1199
1211
|
next = generatorNext
|
|
1200
1212
|
}
|
|
@@ -1358,8 +1370,12 @@ do
|
|
|
1358
1370
|
Map[Symbol.species] = Map
|
|
1359
1371
|
end
|
|
1360
1372
|
|
|
1373
|
+
local __TS__Match = string.match
|
|
1374
|
+
|
|
1361
1375
|
local __TS__MathAtan2 = math.atan2 or math.atan
|
|
1362
1376
|
|
|
1377
|
+
local __TS__MathModf = math.modf
|
|
1378
|
+
|
|
1363
1379
|
local function __TS__MathSign(val)
|
|
1364
1380
|
if val > 0 then
|
|
1365
1381
|
return 1
|
|
@@ -1369,6 +1385,10 @@ local function __TS__MathSign(val)
|
|
|
1369
1385
|
return 0
|
|
1370
1386
|
end
|
|
1371
1387
|
|
|
1388
|
+
local function __TS__Modulo50(a, b)
|
|
1389
|
+
return a - math.floor(a / b) * b
|
|
1390
|
+
end
|
|
1391
|
+
|
|
1372
1392
|
local function __TS__Number(value)
|
|
1373
1393
|
local valueType = type(value)
|
|
1374
1394
|
if valueType == "number" then
|
|
@@ -1415,7 +1435,7 @@ do
|
|
|
1415
1435
|
if radix < 2 or radix > 36 then
|
|
1416
1436
|
error("toString() radix argument must be between 2 and 36", 0)
|
|
1417
1437
|
end
|
|
1418
|
-
local integer, fraction =
|
|
1438
|
+
local integer, fraction = __TS__MathModf(math.abs(self))
|
|
1419
1439
|
local result = ""
|
|
1420
1440
|
if radix == 8 then
|
|
1421
1441
|
result = string.format("%o", integer)
|
|
@@ -1571,7 +1591,7 @@ local function __TS__ObjectValues(obj)
|
|
|
1571
1591
|
end
|
|
1572
1592
|
|
|
1573
1593
|
local function __TS__ParseFloat(numberString)
|
|
1574
|
-
local infinityMatch =
|
|
1594
|
+
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1575
1595
|
if infinityMatch then
|
|
1576
1596
|
local ____temp_0
|
|
1577
1597
|
if __TS__StringAccess(infinityMatch, 0) == "-" then
|
|
@@ -1581,7 +1601,7 @@ local function __TS__ParseFloat(numberString)
|
|
|
1581
1601
|
end
|
|
1582
1602
|
return ____temp_0
|
|
1583
1603
|
end
|
|
1584
|
-
local number = tonumber(
|
|
1604
|
+
local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
|
|
1585
1605
|
local ____number_1 = number
|
|
1586
1606
|
if ____number_1 == nil then
|
|
1587
1607
|
____number_1 = 0 / 0
|
|
@@ -1629,16 +1649,16 @@ do
|
|
|
1629
1649
|
function __TS__ParseInt(numberString, base)
|
|
1630
1650
|
if base == nil then
|
|
1631
1651
|
base = 10
|
|
1632
|
-
local hexMatch =
|
|
1652
|
+
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1633
1653
|
if hexMatch then
|
|
1634
1654
|
base = 16
|
|
1635
|
-
local
|
|
1636
|
-
if
|
|
1637
|
-
|
|
1655
|
+
local ____TS__Match_result__0_0
|
|
1656
|
+
if __TS__Match(hexMatch, "-") then
|
|
1657
|
+
____TS__Match_result__0_0 = "-" .. __TS__StringSubstr(numberString, #hexMatch)
|
|
1638
1658
|
else
|
|
1639
|
-
|
|
1659
|
+
____TS__Match_result__0_0 = __TS__StringSubstr(numberString, #hexMatch)
|
|
1640
1660
|
end
|
|
1641
|
-
numberString =
|
|
1661
|
+
numberString = ____TS__Match_result__0_0
|
|
1642
1662
|
end
|
|
1643
1663
|
end
|
|
1644
1664
|
if base < 2 or base > 36 then
|
|
@@ -1653,7 +1673,7 @@ do
|
|
|
1653
1673
|
local allowedDigits = ____temp_1
|
|
1654
1674
|
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1655
1675
|
local number = tonumber(
|
|
1656
|
-
|
|
1676
|
+
__TS__Match(numberString, pattern),
|
|
1657
1677
|
base
|
|
1658
1678
|
)
|
|
1659
1679
|
if number == nil then
|
|
@@ -1965,13 +1985,13 @@ end
|
|
|
1965
1985
|
|
|
1966
1986
|
local function __TS__SparseArrayNew(...)
|
|
1967
1987
|
local sparseArray = {...}
|
|
1968
|
-
sparseArray.sparseLength =
|
|
1988
|
+
sparseArray.sparseLength = __TS__CountVarargs(...)
|
|
1969
1989
|
return sparseArray
|
|
1970
1990
|
end
|
|
1971
1991
|
|
|
1972
1992
|
local function __TS__SparseArrayPush(sparseArray, ...)
|
|
1973
1993
|
local args = {...}
|
|
1974
|
-
local argsLen =
|
|
1994
|
+
local argsLen = __TS__CountVarargs(...)
|
|
1975
1995
|
local listLen = sparseArray.sparseLength
|
|
1976
1996
|
for i = 1, argsLen do
|
|
1977
1997
|
sparseArray[listLen + i] = args[i]
|
|
@@ -2086,6 +2106,8 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2086
2106
|
local trace
|
|
2087
2107
|
if thread == nil and message == nil and level == nil then
|
|
2088
2108
|
trace = originalTraceback()
|
|
2109
|
+
elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
2110
|
+
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
|
|
2089
2111
|
else
|
|
2090
2112
|
trace = originalTraceback(thread, message, level)
|
|
2091
2113
|
end
|
|
@@ -2111,7 +2133,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2111
2133
|
local function stringReplacer(____, file, line)
|
|
2112
2134
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2113
2135
|
if fileSourceMap and fileSourceMap[line] then
|
|
2114
|
-
local chunkName =
|
|
2136
|
+
local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
|
|
2115
2137
|
local sourceName = string.gsub(chunkName, ".lua$", ".ts")
|
|
2116
2138
|
local data = fileSourceMap[line]
|
|
2117
2139
|
if type(data) == "number" then
|
|
@@ -2178,16 +2200,6 @@ local function __TS__StringEndsWith(self, searchString, endPosition)
|
|
|
2178
2200
|
return string.sub(self, endPosition - #searchString + 1, endPosition) == searchString
|
|
2179
2201
|
end
|
|
2180
2202
|
|
|
2181
|
-
local function __TS__StringIncludes(self, searchString, position)
|
|
2182
|
-
if not position then
|
|
2183
|
-
position = 1
|
|
2184
|
-
else
|
|
2185
|
-
position = position + 1
|
|
2186
|
-
end
|
|
2187
|
-
local index = string.find(self, searchString, position, true)
|
|
2188
|
-
return index ~= nil
|
|
2189
|
-
end
|
|
2190
|
-
|
|
2191
2203
|
local function __TS__StringPadEnd(self, maxLength, fillString)
|
|
2192
2204
|
if fillString == nil then
|
|
2193
2205
|
fillString = " "
|
|
@@ -2443,6 +2455,7 @@ return {
|
|
|
2443
2455
|
__TS__Class = __TS__Class,
|
|
2444
2456
|
__TS__ClassExtends = __TS__ClassExtends,
|
|
2445
2457
|
__TS__CloneDescriptor = __TS__CloneDescriptor,
|
|
2458
|
+
__TS__CountVarargs = __TS__CountVarargs,
|
|
2446
2459
|
__TS__Decorate = __TS__Decorate,
|
|
2447
2460
|
__TS__DecorateParam = __TS__DecorateParam,
|
|
2448
2461
|
__TS__Delete = __TS__Delete,
|
|
@@ -2460,8 +2473,11 @@ return {
|
|
|
2460
2473
|
__TS__Iterator = __TS__Iterator,
|
|
2461
2474
|
__TS__LuaIteratorSpread = __TS__LuaIteratorSpread,
|
|
2462
2475
|
Map = Map,
|
|
2476
|
+
__TS__Match = __TS__Match,
|
|
2463
2477
|
__TS__MathAtan2 = __TS__MathAtan2,
|
|
2478
|
+
__TS__MathModf = __TS__MathModf,
|
|
2464
2479
|
__TS__MathSign = __TS__MathSign,
|
|
2480
|
+
__TS__Modulo50 = __TS__Modulo50,
|
|
2465
2481
|
__TS__New = __TS__New,
|
|
2466
2482
|
__TS__Number = __TS__Number,
|
|
2467
2483
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
package/dist/package.lua
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
return {
|
|
2
2
|
name = "isaacscript-common",
|
|
3
|
-
version = "
|
|
3
|
+
version = "10.0.2",
|
|
4
4
|
description = "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
6
6
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -11,5 +11,5 @@ return {
|
|
|
11
11
|
type = "commonjs",
|
|
12
12
|
main = "dist/src/index",
|
|
13
13
|
types = "dist/src/index.d.ts",
|
|
14
|
-
dependencies = {["isaac-typescript-definitions"] = "^
|
|
14
|
+
dependencies = {["isaac-typescript-definitions"] = "^7.2.0"}
|
|
15
15
|
}
|
|
@@ -6,16 +6,21 @@ import { JSONRoom } from "../interfaces/JSONRoomsFile";
|
|
|
6
6
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
7
7
|
* all of the entries and grid entities in the provided JSON room.
|
|
8
8
|
*
|
|
9
|
+
* You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
|
|
10
|
+
* my-rooms.xml`).
|
|
11
|
+
*
|
|
9
12
|
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
10
13
|
*
|
|
11
14
|
* For example:
|
|
12
15
|
*
|
|
13
16
|
* ```ts
|
|
14
17
|
*
|
|
15
|
-
* import customRooms from "./customRooms";
|
|
18
|
+
* import customRooms from "./customRooms.json";
|
|
16
19
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
20
|
+
* export function postNewRoom(): void {
|
|
21
|
+
* const firstJSONRoom = customRooms.rooms.room[0];
|
|
22
|
+
* deployJSONRoom(firstJSONRoom);
|
|
23
|
+
* }
|
|
19
24
|
* ```
|
|
20
25
|
*
|
|
21
26
|
* @param jsonRoom The JSON room to deploy. *
|
|
@@ -30,6 +35,9 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
|
|
|
30
35
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
31
36
|
* all of the entries and grid entities in one of the provided JSON rooms.
|
|
32
37
|
*
|
|
38
|
+
* You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
|
|
39
|
+
* my-rooms.xml`).
|
|
40
|
+
*
|
|
33
41
|
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
34
42
|
*
|
|
35
43
|
* Note that this function does not simply choose a random element in the provided array; it will
|
|
@@ -39,10 +47,12 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
|
|
|
39
47
|
* For example:
|
|
40
48
|
*
|
|
41
49
|
* ```ts
|
|
42
|
-
* import customRooms from "./customRooms";
|
|
50
|
+
* import customRooms from "./customRooms.json";
|
|
43
51
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
52
|
+
* export function postNewRoom(): void {
|
|
53
|
+
* const jsonRooms = customRooms.rooms.room;
|
|
54
|
+
* deployRandomJSONRoom(jsonRooms);
|
|
55
|
+
* }
|
|
46
56
|
* ```
|
|
47
57
|
*
|
|
48
58
|
* @param jsonRooms An array of JSON rooms to randomly select from. In practice, this will be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAuDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAuKvD
|
|
1
|
+
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAuDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAuKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
|
|
@@ -490,16 +490,21 @@ end
|
|
|
490
490
|
-- Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
491
491
|
-- all of the entries and grid entities in the provided JSON room.
|
|
492
492
|
--
|
|
493
|
+
-- You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
|
|
494
|
+
-- my-rooms.xml`).
|
|
495
|
+
--
|
|
493
496
|
-- This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
494
497
|
--
|
|
495
498
|
-- For example:
|
|
496
499
|
--
|
|
497
500
|
-- ```ts
|
|
498
501
|
--
|
|
499
|
-
-- import customRooms from "./customRooms";
|
|
502
|
+
-- import customRooms from "./customRooms.json";
|
|
500
503
|
--
|
|
501
|
-
--
|
|
502
|
-
--
|
|
504
|
+
-- export function postNewRoom(): void {
|
|
505
|
+
-- const firstJSONRoom = customRooms.rooms.room[0];
|
|
506
|
+
-- deployJSONRoom(firstJSONRoom);
|
|
507
|
+
-- }
|
|
503
508
|
-- ```
|
|
504
509
|
--
|
|
505
510
|
-- @param jsonRoom The JSON room to deploy. *
|
|
@@ -537,6 +542,9 @@ end
|
|
|
537
542
|
-- Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
538
543
|
-- all of the entries and grid entities in one of the provided JSON rooms.
|
|
539
544
|
--
|
|
545
|
+
-- You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
|
|
546
|
+
-- my-rooms.xml`).
|
|
547
|
+
--
|
|
540
548
|
-- This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
541
549
|
--
|
|
542
550
|
-- Note that this function does not simply choose a random element in the provided array; it will
|
|
@@ -546,10 +554,12 @@ end
|
|
|
546
554
|
-- For example:
|
|
547
555
|
--
|
|
548
556
|
-- ```ts
|
|
549
|
-
-- import customRooms from "./customRooms";
|
|
557
|
+
-- import customRooms from "./customRooms.json";
|
|
550
558
|
--
|
|
551
|
-
--
|
|
552
|
-
--
|
|
559
|
+
-- export function postNewRoom(): void {
|
|
560
|
+
-- const jsonRooms = customRooms.rooms.room;
|
|
561
|
+
-- deployRandomJSONRoom(jsonRooms);
|
|
562
|
+
-- }
|
|
553
563
|
-- ```
|
|
554
564
|
--
|
|
555
565
|
-- @param jsonRooms An array of JSON rooms to randomly select from. In practice, this will be
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SaveData } from "../../interfaces/SaveData";
|
|
4
4
|
export declare function loadFromDisk(mod: Mod, oldSaveData: LuaMap<string, SaveData>): void;
|
|
5
5
|
//# sourceMappingURL=load.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
2
|
import { SaveData } from "../../interfaces/SaveData";
|
|
3
3
|
/**
|
|
4
4
|
* The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
2
|
/**
|
|
3
3
|
* `merge` takes the values from a new table and recursively merges them into an old object (while
|
|
4
4
|
* performing appropriate deserialization).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SaveData } from "../../interfaces/SaveData";
|
|
4
4
|
export declare function saveToDisk(mod: Mod, saveDataMap: LuaMap<string, SaveData>, saveDataConditionalFuncMap: LuaMap<string, () => boolean>): void;
|
|
5
5
|
//# sourceMappingURL=save.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
-
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
+
import { CopyableIsaacAPIClassType } from "isaac-typescript-definitions";
|
|
3
3
|
export declare type SerializedBitSet128 = LuaMap<string, unknown> & {
|
|
4
4
|
readonly __serializedBitSet128Brand: symbol;
|
|
5
|
+
readonly __kind: CopyableIsaacAPIClassType.BIT_SET_128;
|
|
5
6
|
};
|
|
6
7
|
/** Helper function to copy a `BitSet128` Isaac API class. */
|
|
7
8
|
export declare function copyBitSet128(bitSet128: BitSet128): BitSet128;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitSet128.d.ts","sourceRoot":"","sources":["../../../src/functions/bitSet128.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitSet128.d.ts","sourceRoot":"","sources":["../../../src/functions/bitSet128.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAUzE,oBAAY,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1D,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,WAAW,CAAC;CACxD,CAAC;AAKF,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,mBAAmB,GAC7B,SAAS,CAqBX;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CAEhE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,mBAAmB,CAQ/B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAW5E"}
|
|
@@ -5,7 +5,7 @@ local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
|
5
5
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
6
6
|
local isIsaacAPIClassOfType = ____isaacAPIClass.isIsaacAPIClassOfType
|
|
7
7
|
local ____table = require("src.functions.table")
|
|
8
|
-
local
|
|
8
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
9
9
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
10
10
|
local tableHasKeys = ____table.tableHasKeys
|
|
11
11
|
local ____types = require("src.functions.types")
|
|
@@ -64,7 +64,7 @@ function ____exports.serializeBitSet128(self, bitSet128)
|
|
|
64
64
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
65
65
|
end
|
|
66
66
|
local bitSet128Table = {}
|
|
67
|
-
|
|
67
|
+
copyUserdataValuesToTable(nil, bitSet128, KEYS, bitSet128Table)
|
|
68
68
|
bitSet128Table[SerializationBrand.BIT_SET_128] = ""
|
|
69
69
|
return bitSet128Table
|
|
70
70
|
end
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
-
|
|
3
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
4
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
+
import { CopyableIsaacAPIClassType } from "isaac-typescript-definitions";
|
|
5
3
|
export declare type SerializedColor = LuaMap<string, unknown> & {
|
|
6
4
|
readonly __serializedColorBrand: symbol;
|
|
5
|
+
readonly __kind: CopyableIsaacAPIClassType.COLOR;
|
|
7
6
|
};
|
|
8
7
|
export declare function colorEquals(color1: Color, color2: Color): boolean;
|
|
9
8
|
/** Helper function to copy a `Color` Isaac API class. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/functions/color.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/functions/color.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAYzE,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,KAAK,CAAC;CAClD,CAAC;AAKF,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAEjE;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAgB7C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CA8B9D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,KAAK,CAQP;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,KAAK,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,eAAe,CAM5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAW5D"}
|
|
@@ -12,7 +12,7 @@ local getRandomSeed = ____rng.getRandomSeed
|
|
|
12
12
|
local isRNG = ____rng.isRNG
|
|
13
13
|
local newRNG = ____rng.newRNG
|
|
14
14
|
local ____table = require("src.functions.table")
|
|
15
|
-
local
|
|
15
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
16
16
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
17
17
|
local tableHasKeys = ____table.tableHasKeys
|
|
18
18
|
local ____types = require("src.functions.types")
|
|
@@ -117,7 +117,7 @@ function ____exports.serializeColor(self, color)
|
|
|
117
117
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
118
118
|
end
|
|
119
119
|
local colorTable = {}
|
|
120
|
-
|
|
120
|
+
copyUserdataValuesToTable(nil, color, KEYS, colorTable)
|
|
121
121
|
colorTable[SerializationBrand.COLOR] = ""
|
|
122
122
|
return colorTable
|
|
123
123
|
end
|
|
@@ -2,7 +2,7 @@ import { LevelCurse } from "isaac-typescript-definitions";
|
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get the actual bit flag for modded curses.
|
|
4
4
|
*
|
|
5
|
-
* Will throw a
|
|
5
|
+
* Will throw a run-time error if the provided curse does not exist.
|
|
6
6
|
*
|
|
7
7
|
* Use this over the `Isaac.GetCurseIdByName` method because that will return an integer instead of
|
|
8
8
|
* a bit flag.
|
|
@@ -5,7 +5,7 @@ local ____flag = require("src.functions.flag")
|
|
|
5
5
|
local hasFlag = ____flag.hasFlag
|
|
6
6
|
--- Helper function to get the actual bit flag for modded curses.
|
|
7
7
|
--
|
|
8
|
-
-- Will throw a
|
|
8
|
+
-- Will throw a run-time error if the provided curse does not exist.
|
|
9
9
|
--
|
|
10
10
|
-- Use this over the `Isaac.GetCurseIdByName` method because that will return an integer instead of
|
|
11
11
|
-- a bit flag.
|
|
@@ -33,5 +33,6 @@ import { SerializationType } from "../enums/SerializationType";
|
|
|
33
33
|
* @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
|
|
34
34
|
* recursively copying a TSTL Map. Default is false.
|
|
35
35
|
*/
|
|
36
|
-
export declare function deepCopy(value:
|
|
36
|
+
export declare function deepCopy<T>(value: T, serializationType?: SerializationType.NONE, traversalDescription?: string, insideMap?: boolean): T;
|
|
37
|
+
export declare function deepCopy(value: unknown, serializationType: SerializationType, traversalDescription?: string, insideMap?: boolean): unknown;
|
|
37
38
|
//# sourceMappingURL=deepCopy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../../src/functions/deepCopy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAyB/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,KAAK,EAAE,CAAC,EACR,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,IAAI,EAC1C,oBAAoB,CAAC,EAAE,MAAM,EAC7B,SAAS,CAAC,EAAE,OAAO,GAClB,CAAC,CAAC;AACL,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,CAAC,EAAE,MAAM,EAC7B,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Set = ____lualib.Set
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
4
3
|
local Map = ____lualib.Map
|
|
4
|
+
local Set = ____lualib.Set
|
|
5
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
6
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
7
7
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
8
8
|
local ____exports = {}
|
|
9
|
-
local deepCopyTable, deepCopyDefaultMap, getNewDefaultMap, deepCopyMap, deepCopySet, deepCopyTSTLClass, deepCopyArray, deepCopyNormalLuaTable, getCopiedEntries, checkMetatable, deepCopyUserdata
|
|
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 ____CopyableIsaacAPIClassType = require("src.enums.private.CopyableIsaacAPIClassType")
|
|
13
|
-
local CopyableIsaacAPIClassType = ____CopyableIsaacAPIClassType.CopyableIsaacAPIClassType
|
|
14
12
|
local ____SerializationBrand = require("src.enums.private.SerializationBrand")
|
|
15
13
|
local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
16
14
|
local ____SerializationType = require("src.enums.SerializationType")
|
|
@@ -21,8 +19,6 @@ local ____serializationBrands = require("src.features.saveDataManager.serializat
|
|
|
21
19
|
local isSerializationBrand = ____serializationBrands.isSerializationBrand
|
|
22
20
|
local ____array = require("src.functions.array")
|
|
23
21
|
local isArray = ____array.isArray
|
|
24
|
-
local ____enums = require("src.functions.enums")
|
|
25
|
-
local getEnumValues = ____enums.getEnumValues
|
|
26
22
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
27
23
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
28
24
|
local ____log = require("src.functions.log")
|
|
@@ -30,6 +26,7 @@ local log = ____log.log
|
|
|
30
26
|
local ____serialization = require("src.functions.serialization")
|
|
31
27
|
local copyIsaacAPIClass = ____serialization.copyIsaacAPIClass
|
|
32
28
|
local deserializeIsaacAPIClass = ____serialization.deserializeIsaacAPIClass
|
|
29
|
+
local isCopyableIsaacAPIClass = ____serialization.isCopyableIsaacAPIClass
|
|
33
30
|
local isSerializedIsaacAPIClass = ____serialization.isSerializedIsaacAPIClass
|
|
34
31
|
local serializeIsaacAPIClass = ____serialization.serializeIsaacAPIClass
|
|
35
32
|
local ____tstlClass = require("src.functions.tstlClass")
|
|
@@ -113,6 +110,9 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
|
|
|
113
110
|
if serializationType == SerializationType.SERIALIZE then
|
|
114
111
|
error((("The deep copy function does not support serialization of \"" .. traversalDescription) .. "\", since it is type: ") .. valueType)
|
|
115
112
|
end
|
|
113
|
+
if serializationType == SerializationType.DESERIALIZE then
|
|
114
|
+
error((("The deep copy function does not support deserialization of \"" .. traversalDescription) .. "\", since it is type: ") .. valueType)
|
|
115
|
+
end
|
|
116
116
|
return value
|
|
117
117
|
end
|
|
118
118
|
end
|
|
@@ -264,15 +264,15 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
|
|
|
264
264
|
end
|
|
265
265
|
function getNewDefaultMap(self, defaultMap, serializationType, traversalDescription, constructorArg)
|
|
266
266
|
repeat
|
|
267
|
-
local
|
|
268
|
-
local
|
|
269
|
-
if
|
|
267
|
+
local ____switch35 = serializationType
|
|
268
|
+
local ____cond35 = ____switch35 == SerializationType.NONE
|
|
269
|
+
if ____cond35 then
|
|
270
270
|
do
|
|
271
271
|
return __TS__New(DefaultMap, constructorArg)
|
|
272
272
|
end
|
|
273
273
|
end
|
|
274
|
-
|
|
275
|
-
if
|
|
274
|
+
____cond35 = ____cond35 or ____switch35 == SerializationType.SERIALIZE
|
|
275
|
+
if ____cond35 then
|
|
276
276
|
do
|
|
277
277
|
local newDefaultMap = {}
|
|
278
278
|
newDefaultMap[SerializationBrand.DEFAULT_MAP] = ""
|
|
@@ -280,8 +280,8 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
|
|
|
280
280
|
return newDefaultMap
|
|
281
281
|
end
|
|
282
282
|
end
|
|
283
|
-
|
|
284
|
-
if
|
|
283
|
+
____cond35 = ____cond35 or ____switch35 == SerializationType.DESERIALIZE
|
|
284
|
+
if ____cond35 then
|
|
285
285
|
do
|
|
286
286
|
if isDefaultMap(nil, defaultMap) then
|
|
287
287
|
error(("The deep copy function failed to deserialize a default map of \"" .. traversalDescription) .. "\", since it was not a Lua table.")
|
|
@@ -481,7 +481,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
|
|
|
481
481
|
local value = ____value[2]
|
|
482
482
|
do
|
|
483
483
|
if isSerializationBrand(nil, key) then
|
|
484
|
-
goto
|
|
484
|
+
goto __continue88
|
|
485
485
|
end
|
|
486
486
|
traversalDescription = getTraversalDescription(nil, key, traversalDescription)
|
|
487
487
|
local newValue = ____exports.deepCopy(
|
|
@@ -503,7 +503,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
|
|
|
503
503
|
end
|
|
504
504
|
copiedEntries[#copiedEntries + 1] = {keyToUse, newValue}
|
|
505
505
|
end
|
|
506
|
-
::
|
|
506
|
+
::__continue88::
|
|
507
507
|
end
|
|
508
508
|
return {entries = copiedEntries, convertedNumberKeysToStrings = convertNumberKeysToStrings}
|
|
509
509
|
end
|
|
@@ -516,15 +516,12 @@ function checkMetatable(self, luaMap, traversalDescription)
|
|
|
516
516
|
error(("The deepCopy function detected that " .. tableDescription) .. " has a metatable. Copying tables with metatables is not supported, unless they are explicitly handled by the save data manager. (e.g. TypeScriptToLua Maps, TypeScriptToLua Sets, etc.)")
|
|
517
517
|
end
|
|
518
518
|
function deepCopyUserdata(self, value, serializationType, traversalDescription)
|
|
519
|
-
if SAVE_DATA_MANAGER_DEBUG then
|
|
520
|
-
log(nil, "deepCopy is copying userdata.")
|
|
521
|
-
end
|
|
522
519
|
local classType = getIsaacAPIClassName(nil, value)
|
|
523
520
|
if classType == nil then
|
|
524
521
|
error("The deep copy function was not able to derive the Isaac API class type for: " .. traversalDescription)
|
|
525
522
|
end
|
|
526
|
-
if not
|
|
527
|
-
error((("The deep copy function does not support
|
|
523
|
+
if not isCopyableIsaacAPIClass(nil, value) then
|
|
524
|
+
error((("The deep copy function does not support serializing \"" .. traversalDescription) .. "\", since it is an Isaac API class of type: ") .. classType)
|
|
528
525
|
end
|
|
529
526
|
repeat
|
|
530
527
|
local ____switch99 = serializationType
|
|
@@ -543,13 +540,10 @@ function deepCopyUserdata(self, value, serializationType, traversalDescription)
|
|
|
543
540
|
____cond99 = ____cond99 or ____switch99 == SerializationType.DESERIALIZE
|
|
544
541
|
if ____cond99 then
|
|
545
542
|
do
|
|
546
|
-
|
|
543
|
+
error(("The deep copy function can not deserialize \"" .. traversalDescription) .. "\", since it is userdata.")
|
|
547
544
|
end
|
|
545
|
+
break
|
|
548
546
|
end
|
|
549
547
|
until true
|
|
550
548
|
end
|
|
551
|
-
COPYABLE_ISAAC_API_CLASS_TYPES_SET = __TS__New(
|
|
552
|
-
Set,
|
|
553
|
-
getEnumValues(nil, CopyableIsaacAPIClassType)
|
|
554
|
-
)
|
|
555
549
|
return ____exports
|