isaacscript-common 21.9.0 → 22.0.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.
- package/dist/index.rollup.d.ts +20 -20
- package/dist/isaacscript-common.lua +102 -138
- package/dist/lualib_bundle.lua +59 -100
- package/dist/src/functions/color.d.ts +1 -1
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/hex.d.ts +2 -2
- package/dist/src/functions/hex.d.ts.map +1 -1
- package/dist/src/functions/kColor.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/log.d.ts +1 -1
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +5 -0
- package/dist/src/functions/positionVelocity.d.ts +1 -1
- package/dist/src/functions/positionVelocity.d.ts.map +1 -1
- package/dist/src/functions/roomGrid.d.ts +5 -5
- package/dist/src/functions/roomGrid.d.ts.map +1 -1
- package/dist/src/functions/ui.d.ts +8 -8
- package/dist/src/functions/ui.d.ts.map +1 -1
- package/dist/src/functions/vector.d.ts +1 -1
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/functions/color.ts +1 -1
- package/src/functions/hex.ts +2 -2
- package/src/functions/kColor.ts +1 -1
- package/src/functions/log.ts +7 -1
- package/src/functions/positionVelocity.ts +1 -1
- package/src/functions/roomGrid.ts +14 -5
- package/src/functions/ui.ts +8 -8
- package/src/functions/vector.ts +1 -1
package/dist/lualib_bundle.lua
CHANGED
|
@@ -762,13 +762,7 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
762
762
|
function(____, resolve, reject)
|
|
763
763
|
local adopt, fulfilled, step, resolved, asyncCoroutine
|
|
764
764
|
function adopt(self, value)
|
|
765
|
-
|
|
766
|
-
if __TS__InstanceOf(value, __TS__Promise) then
|
|
767
|
-
____temp_0 = value
|
|
768
|
-
else
|
|
769
|
-
____temp_0 = __TS__Promise.resolve(value)
|
|
770
|
-
end
|
|
771
|
-
return ____temp_0
|
|
765
|
+
return __TS__InstanceOf(value, __TS__Promise) and value or __TS__Promise.resolve(value)
|
|
772
766
|
end
|
|
773
767
|
function fulfilled(self, value)
|
|
774
768
|
local success, resultOrError = coroutine.resume(asyncCoroutine, value)
|
|
@@ -785,8 +779,8 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
785
779
|
if coroutine.status(asyncCoroutine) == "dead" then
|
|
786
780
|
resolve(nil, result)
|
|
787
781
|
else
|
|
788
|
-
local
|
|
789
|
-
|
|
782
|
+
local ____self_0 = adopt(nil, result)
|
|
783
|
+
____self_0["then"](____self_0, fulfilled, reject)
|
|
790
784
|
end
|
|
791
785
|
end
|
|
792
786
|
resolved = false
|
|
@@ -795,8 +789,8 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
795
789
|
asyncCoroutine,
|
|
796
790
|
function(____, v)
|
|
797
791
|
resolved = true
|
|
798
|
-
local
|
|
799
|
-
|
|
792
|
+
local ____self_1 = adopt(nil, v)
|
|
793
|
+
____self_1["then"](____self_1, resolve, reject)
|
|
800
794
|
end
|
|
801
795
|
)
|
|
802
796
|
if success then
|
|
@@ -903,7 +897,7 @@ do
|
|
|
903
897
|
local descriptors = rawget(metatable, "_descriptors")
|
|
904
898
|
if descriptors then
|
|
905
899
|
local descriptor = descriptors[key]
|
|
906
|
-
if descriptor then
|
|
900
|
+
if descriptor ~= nil then
|
|
907
901
|
if descriptor.get then
|
|
908
902
|
return descriptor.get(self)
|
|
909
903
|
end
|
|
@@ -919,7 +913,7 @@ do
|
|
|
919
913
|
local descriptors = rawget(metatable, "_descriptors")
|
|
920
914
|
if descriptors then
|
|
921
915
|
local descriptor = descriptors[key]
|
|
922
|
-
if descriptor then
|
|
916
|
+
if descriptor ~= nil then
|
|
923
917
|
if descriptor.set then
|
|
924
918
|
descriptor.set(self, value)
|
|
925
919
|
else
|
|
@@ -972,7 +966,7 @@ local function __TS__Decorate(decorators, target, key, desc)
|
|
|
972
966
|
local i = #decorators
|
|
973
967
|
while i >= 0 do
|
|
974
968
|
local decorator = decorators[i + 1]
|
|
975
|
-
if decorator then
|
|
969
|
+
if decorator ~= nil then
|
|
976
970
|
local oldResult = result
|
|
977
971
|
if key == nil then
|
|
978
972
|
result = decorator(nil, result)
|
|
@@ -1045,7 +1039,7 @@ do
|
|
|
1045
1039
|
if isClassicLua or caller and caller.func ~= error then
|
|
1046
1040
|
return description
|
|
1047
1041
|
else
|
|
1048
|
-
return (
|
|
1042
|
+
return (description .. "\n") .. tostring(self.stack)
|
|
1049
1043
|
end
|
|
1050
1044
|
end
|
|
1051
1045
|
end
|
|
@@ -1056,7 +1050,7 @@ do
|
|
|
1056
1050
|
{__call = function(____, _self, message) return __TS__New(Type, message) end}
|
|
1057
1051
|
)
|
|
1058
1052
|
end
|
|
1059
|
-
local
|
|
1053
|
+
local ____initErrorClass_1 = initErrorClass
|
|
1060
1054
|
local ____class_0 = __TS__Class()
|
|
1061
1055
|
____class_0.name = ""
|
|
1062
1056
|
function ____class_0.prototype.____constructor(self, message)
|
|
@@ -1067,31 +1061,25 @@ do
|
|
|
1067
1061
|
self.name = "Error"
|
|
1068
1062
|
self.stack = getErrorStack(nil, self.constructor.new)
|
|
1069
1063
|
local metatable = getmetatable(self)
|
|
1070
|
-
if not metatable.__errorToStringPatched then
|
|
1064
|
+
if metatable and not metatable.__errorToStringPatched then
|
|
1071
1065
|
metatable.__errorToStringPatched = true
|
|
1072
1066
|
metatable.__tostring = wrapErrorToString(nil, metatable.__tostring)
|
|
1073
1067
|
end
|
|
1074
1068
|
end
|
|
1075
1069
|
function ____class_0.prototype.__tostring(self)
|
|
1076
|
-
|
|
1077
|
-
if self.message ~= "" then
|
|
1078
|
-
____temp_1 = (self.name .. ": ") .. self.message
|
|
1079
|
-
else
|
|
1080
|
-
____temp_1 = self.name
|
|
1081
|
-
end
|
|
1082
|
-
return ____temp_1
|
|
1070
|
+
return self.message ~= "" and (self.name .. ": ") .. self.message or self.name
|
|
1083
1071
|
end
|
|
1084
|
-
Error =
|
|
1072
|
+
Error = ____initErrorClass_1(nil, ____class_0, "Error")
|
|
1085
1073
|
local function createErrorClass(self, name)
|
|
1086
|
-
local
|
|
1087
|
-
local
|
|
1088
|
-
|
|
1089
|
-
__TS__ClassExtends(
|
|
1090
|
-
function
|
|
1091
|
-
|
|
1074
|
+
local ____initErrorClass_3 = initErrorClass
|
|
1075
|
+
local ____class_2 = __TS__Class()
|
|
1076
|
+
____class_2.name = ____class_2.name
|
|
1077
|
+
__TS__ClassExtends(____class_2, Error)
|
|
1078
|
+
function ____class_2.prototype.____constructor(self, ...)
|
|
1079
|
+
____class_2.____super.prototype.____constructor(self, ...)
|
|
1092
1080
|
self.name = name
|
|
1093
1081
|
end
|
|
1094
|
-
return
|
|
1082
|
+
return ____initErrorClass_3(nil, ____class_2, name)
|
|
1095
1083
|
end
|
|
1096
1084
|
RangeError = createErrorClass(nil, "RangeError")
|
|
1097
1085
|
ReferenceError = createErrorClass(nil, "ReferenceError")
|
|
@@ -1261,13 +1249,13 @@ do
|
|
|
1261
1249
|
self.size = self.size - 1
|
|
1262
1250
|
local next = self.nextKey[key]
|
|
1263
1251
|
local previous = self.previousKey[key]
|
|
1264
|
-
if next and previous then
|
|
1252
|
+
if next ~= nil and previous ~= nil then
|
|
1265
1253
|
self.nextKey[previous] = next
|
|
1266
1254
|
self.previousKey[next] = previous
|
|
1267
|
-
elseif next then
|
|
1255
|
+
elseif next ~= nil then
|
|
1268
1256
|
self.firstKey = next
|
|
1269
1257
|
self.previousKey[next] = nil
|
|
1270
|
-
elseif previous then
|
|
1258
|
+
elseif previous ~= nil then
|
|
1271
1259
|
self.lastKey = previous
|
|
1272
1260
|
self.nextKey[previous] = nil
|
|
1273
1261
|
else
|
|
@@ -1453,13 +1441,7 @@ do
|
|
|
1453
1441
|
end
|
|
1454
1442
|
|
|
1455
1443
|
local function __TS__ObjectDefineProperty(target, key, desc)
|
|
1456
|
-
local
|
|
1457
|
-
if type(key) == "number" then
|
|
1458
|
-
____temp_0 = key + 1
|
|
1459
|
-
else
|
|
1460
|
-
____temp_0 = key
|
|
1461
|
-
end
|
|
1462
|
-
local luaKey = ____temp_0
|
|
1444
|
+
local luaKey = type(key) == "number" and key + 1 or key
|
|
1463
1445
|
local value = rawget(target, luaKey)
|
|
1464
1446
|
local hasGetterOrSetter = desc.get ~= nil or desc.set ~= nil
|
|
1465
1447
|
local descriptor
|
|
@@ -1473,39 +1455,39 @@ local function __TS__ObjectDefineProperty(target, key, desc)
|
|
|
1473
1455
|
descriptor = desc
|
|
1474
1456
|
else
|
|
1475
1457
|
local valueExists = value ~= nil
|
|
1476
|
-
local
|
|
1477
|
-
local
|
|
1478
|
-
local
|
|
1458
|
+
local ____desc_set_4 = desc.set
|
|
1459
|
+
local ____desc_get_5 = desc.get
|
|
1460
|
+
local ____temp_0
|
|
1479
1461
|
if desc.configurable ~= nil then
|
|
1480
|
-
|
|
1462
|
+
____temp_0 = desc.configurable
|
|
1481
1463
|
else
|
|
1482
|
-
|
|
1464
|
+
____temp_0 = valueExists
|
|
1483
1465
|
end
|
|
1484
|
-
local
|
|
1466
|
+
local ____temp_1
|
|
1485
1467
|
if desc.enumerable ~= nil then
|
|
1486
|
-
|
|
1468
|
+
____temp_1 = desc.enumerable
|
|
1487
1469
|
else
|
|
1488
|
-
|
|
1470
|
+
____temp_1 = valueExists
|
|
1489
1471
|
end
|
|
1490
|
-
local
|
|
1472
|
+
local ____temp_2
|
|
1491
1473
|
if desc.writable ~= nil then
|
|
1492
|
-
|
|
1474
|
+
____temp_2 = desc.writable
|
|
1493
1475
|
else
|
|
1494
|
-
|
|
1476
|
+
____temp_2 = valueExists
|
|
1495
1477
|
end
|
|
1496
|
-
local
|
|
1478
|
+
local ____temp_3
|
|
1497
1479
|
if desc.value ~= nil then
|
|
1498
|
-
|
|
1480
|
+
____temp_3 = desc.value
|
|
1499
1481
|
else
|
|
1500
|
-
|
|
1482
|
+
____temp_3 = value
|
|
1501
1483
|
end
|
|
1502
1484
|
descriptor = {
|
|
1503
|
-
set =
|
|
1504
|
-
get =
|
|
1505
|
-
configurable =
|
|
1506
|
-
enumerable =
|
|
1507
|
-
writable =
|
|
1508
|
-
value =
|
|
1485
|
+
set = ____desc_set_4,
|
|
1486
|
+
get = ____desc_get_5,
|
|
1487
|
+
configurable = ____temp_0,
|
|
1488
|
+
enumerable = ____temp_1,
|
|
1489
|
+
writable = ____temp_2,
|
|
1490
|
+
value = ____temp_3
|
|
1509
1491
|
}
|
|
1510
1492
|
end
|
|
1511
1493
|
__TS__SetDescriptor(target, luaKey, descriptor)
|
|
@@ -1575,14 +1557,8 @@ end
|
|
|
1575
1557
|
|
|
1576
1558
|
local function __TS__ParseFloat(numberString)
|
|
1577
1559
|
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1578
|
-
if infinityMatch then
|
|
1579
|
-
|
|
1580
|
-
if __TS__StringAccess(infinityMatch, 0) == "-" then
|
|
1581
|
-
____temp_0 = -math.huge
|
|
1582
|
-
else
|
|
1583
|
-
____temp_0 = math.huge
|
|
1584
|
-
end
|
|
1585
|
-
return ____temp_0
|
|
1560
|
+
if infinityMatch ~= nil then
|
|
1561
|
+
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1586
1562
|
end
|
|
1587
1563
|
local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
|
|
1588
1564
|
return number or 0 / 0
|
|
@@ -1613,27 +1589,15 @@ do
|
|
|
1613
1589
|
if base == nil then
|
|
1614
1590
|
base = 10
|
|
1615
1591
|
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1616
|
-
if hexMatch then
|
|
1592
|
+
if hexMatch ~= nil then
|
|
1617
1593
|
base = 16
|
|
1618
|
-
|
|
1619
|
-
if __TS__Match(hexMatch, "-") then
|
|
1620
|
-
____TS__Match_result__0_0 = "-" .. __TS__StringSubstring(numberString, #hexMatch)
|
|
1621
|
-
else
|
|
1622
|
-
____TS__Match_result__0_0 = __TS__StringSubstring(numberString, #hexMatch)
|
|
1623
|
-
end
|
|
1624
|
-
numberString = ____TS__Match_result__0_0
|
|
1594
|
+
numberString = __TS__Match(hexMatch, "-") and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1625
1595
|
end
|
|
1626
1596
|
end
|
|
1627
1597
|
if base < 2 or base > 36 then
|
|
1628
1598
|
return 0 / 0
|
|
1629
1599
|
end
|
|
1630
|
-
local
|
|
1631
|
-
if base <= 10 then
|
|
1632
|
-
____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, base)
|
|
1633
|
-
else
|
|
1634
|
-
____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1635
|
-
end
|
|
1636
|
-
local allowedDigits = ____temp_1
|
|
1600
|
+
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1637
1601
|
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1638
1602
|
local number = tonumber(
|
|
1639
1603
|
__TS__Match(numberString, pattern),
|
|
@@ -1872,13 +1836,13 @@ do
|
|
|
1872
1836
|
self.size = self.size - 1
|
|
1873
1837
|
local next = self.nextKey[value]
|
|
1874
1838
|
local previous = self.previousKey[value]
|
|
1875
|
-
if next and previous then
|
|
1839
|
+
if next ~= nil and previous ~= nil then
|
|
1876
1840
|
self.nextKey[previous] = next
|
|
1877
1841
|
self.previousKey[next] = previous
|
|
1878
|
-
elseif next then
|
|
1842
|
+
elseif next ~= nil then
|
|
1879
1843
|
self.firstKey = next
|
|
1880
1844
|
self.previousKey[next] = nil
|
|
1881
|
-
elseif previous then
|
|
1845
|
+
elseif previous ~= nil then
|
|
1882
1846
|
self.lastKey = previous
|
|
1883
1847
|
self.nextKey[previous] = nil
|
|
1884
1848
|
else
|
|
@@ -2066,7 +2030,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2066
2030
|
if thread == nil and message == nil and level == nil then
|
|
2067
2031
|
trace = originalTraceback()
|
|
2068
2032
|
elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
2069
|
-
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
|
|
2033
|
+
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. tostring(message))
|
|
2070
2034
|
else
|
|
2071
2035
|
trace = originalTraceback(thread, message, level)
|
|
2072
2036
|
end
|
|
@@ -2075,12 +2039,12 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2075
2039
|
end
|
|
2076
2040
|
local function replacer(____, file, srcFile, line)
|
|
2077
2041
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2078
|
-
if fileSourceMap and fileSourceMap[line] then
|
|
2042
|
+
if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
|
|
2079
2043
|
local data = fileSourceMap[line]
|
|
2080
2044
|
if type(data) == "number" then
|
|
2081
2045
|
return (srcFile .. ":") .. tostring(data)
|
|
2082
2046
|
end
|
|
2083
|
-
return (
|
|
2047
|
+
return (data.file .. ":") .. tostring(data.line)
|
|
2084
2048
|
end
|
|
2085
2049
|
return (file .. ":") .. line
|
|
2086
2050
|
end
|
|
@@ -2091,14 +2055,14 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2091
2055
|
)
|
|
2092
2056
|
local function stringReplacer(____, file, line)
|
|
2093
2057
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2094
|
-
if fileSourceMap and fileSourceMap[line] then
|
|
2058
|
+
if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
|
|
2095
2059
|
local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
|
|
2096
2060
|
local sourceName = string.gsub(chunkName, ".lua$", ".ts")
|
|
2097
2061
|
local data = fileSourceMap[line]
|
|
2098
2062
|
if type(data) == "number" then
|
|
2099
2063
|
return (sourceName .. ":") .. tostring(data)
|
|
2100
2064
|
end
|
|
2101
|
-
return (
|
|
2065
|
+
return (data.file .. ":") .. tostring(data.line)
|
|
2102
2066
|
end
|
|
2103
2067
|
return (file .. ":") .. line
|
|
2104
2068
|
end
|
|
@@ -2218,13 +2182,7 @@ do
|
|
|
2218
2182
|
return source
|
|
2219
2183
|
end
|
|
2220
2184
|
local before = sub(source, 1, startPos - 1)
|
|
2221
|
-
local
|
|
2222
|
-
if type(replaceValue) == "string" then
|
|
2223
|
-
____temp_0 = replaceValue
|
|
2224
|
-
else
|
|
2225
|
-
____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
|
|
2226
|
-
end
|
|
2227
|
-
local replacement = ____temp_0
|
|
2185
|
+
local replacement = type(replaceValue) == "string" and replaceValue or replaceValue(nil, searchValue, startPos - 1, source)
|
|
2228
2186
|
local after = sub(source, endPos + 1)
|
|
2229
2187
|
return (before .. replacement) .. after
|
|
2230
2188
|
end
|
|
@@ -2379,6 +2337,7 @@ do
|
|
|
2379
2337
|
return key
|
|
2380
2338
|
end
|
|
2381
2339
|
end
|
|
2340
|
+
return nil
|
|
2382
2341
|
end
|
|
2383
2342
|
end
|
|
2384
2343
|
|
|
@@ -19,7 +19,7 @@ export declare function deserializeColor(color: SerializedColor): Color;
|
|
|
19
19
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
20
20
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
21
21
|
*/
|
|
22
|
-
export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Color
|
|
22
|
+
export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<Color>;
|
|
23
23
|
/** Helper function to check if something is an instantiated `Color` object. */
|
|
24
24
|
export declare function isColor(object: unknown): object is Color;
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/functions/color.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAYzE,MAAM,MAAM,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,
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/functions/color.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAYzE,MAAM,MAAM,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,QAAQ,CAAC,KAAK,CAAC,CAQjB;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"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
7
7
|
* @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
|
|
8
8
|
*/
|
|
9
|
-
export declare function hexToColor(hexString: string, alpha?: number): Color
|
|
9
|
+
export declare function hexToColor(hexString: string, alpha?: number): Readonly<Color>;
|
|
10
10
|
/**
|
|
11
11
|
* Converts a hex string like "#33aa33" to a Color object.
|
|
12
12
|
*
|
|
13
13
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
14
14
|
* @param alpha Range is from 0 to 1. Default is 1.
|
|
15
15
|
*/
|
|
16
|
-
export declare function hexToKColor(hexString: string, alpha?: number): KColor
|
|
16
|
+
export declare function hexToKColor(hexString: string, alpha?: number): Readonly<KColor>;
|
|
17
17
|
//# sourceMappingURL=hex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../src/functions/hex.ts"],"names":[],"mappings":";;AAIA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../src/functions/hex.ts"],"names":[],"mappings":";;AAIA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAM1E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAM5E"}
|
|
@@ -18,7 +18,7 @@ export declare function deserializeKColor(kColor: SerializedKColor): KColor;
|
|
|
18
18
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
19
19
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
20
20
|
*/
|
|
21
|
-
export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): KColor
|
|
21
|
+
export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<KColor>;
|
|
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
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kColor.d.ts","sourceRoot":"","sources":["../../../src/functions/kColor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAYzE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,OAAO,CAAC;CACpD,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA+BlE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,MAAM,
|
|
1
|
+
{"version":3,"file":"kColor.d.ts","sourceRoot":"","sources":["../../../src/functions/kColor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAYzE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,OAAO,CAAC;CACpD,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA+BlE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,QAAQ,CAAC,MAAM,CAAC,CAQlB;AAED,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gBAAgB,CAQ5B;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAWhE"}
|
|
@@ -26,7 +26,7 @@ export declare function getParentFunctionDescription(this: void, levels?: number
|
|
|
26
26
|
* @param includeParentFunction Optional. Whether to prefix the message with the function name and
|
|
27
27
|
* line number, as shown in the above example. Default is true.
|
|
28
28
|
*/
|
|
29
|
-
export declare function log(this: void, msg: string, includeParentFunction?: boolean): void;
|
|
29
|
+
export declare function log(this: void, msg: string | number, includeParentFunction?: boolean): void;
|
|
30
30
|
/**
|
|
31
31
|
* Helper function to log a message to the "log.txt" file and to print it to the screen at the same
|
|
32
32
|
* time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,EAKV,MAAM,SAAI,GACT,MAAM,GAAG,SAAS,CAiBpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,GAAG,CACjB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,qBAAqB,UAAO,GAC3B,IAAI,CAaN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAG7C"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local ____types = require("src.functions.types")
|
|
3
|
+
local isNumber = ____types.isNumber
|
|
2
4
|
--- Helper function to get the name and the line number of the current calling function.
|
|
3
5
|
--
|
|
4
6
|
-- For this function to work properly, the "--luadebug" flag must be enabled. Otherwise, it will
|
|
@@ -41,6 +43,9 @@ function ____exports.log(msg, includeParentFunction)
|
|
|
41
43
|
if includeParentFunction == nil then
|
|
42
44
|
includeParentFunction = true
|
|
43
45
|
end
|
|
46
|
+
if isNumber(nil, msg) then
|
|
47
|
+
msg = tostring(msg)
|
|
48
|
+
end
|
|
44
49
|
local ____includeParentFunction_0
|
|
45
50
|
if includeParentFunction then
|
|
46
51
|
____includeParentFunction_0 = ____exports.getParentFunctionDescription()
|
|
@@ -23,7 +23,7 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
|
|
|
23
23
|
* @param minimumDistance Optional. If specified, will ensure that the randomly generated position
|
|
24
24
|
* is equal to or greater than the distance provided.
|
|
25
25
|
*/
|
|
26
|
-
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector
|
|
26
|
+
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Readonly<Vector>;
|
|
27
27
|
/**
|
|
28
28
|
* Helper function to get a map containing the positions of every entity in the current room.
|
|
29
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionVelocity.d.ts","sourceRoot":"","sources":["../../../src/functions/positionVelocity.ts"],"names":[],"mappings":";;;;AAaA,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,GACZ,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,KAAK,GACd,OAAO,CAKT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,UAAQ,EAC3B,eAAe,CAAC,EAAE,KAAK,GACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"positionVelocity.d.ts","sourceRoot":"","sources":["../../../src/functions/positionVelocity.ts"],"names":[],"mappings":";;;;AAaA,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,GACZ,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,KAAK,GACd,OAAO,CAKT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,UAAQ,EAC3B,eAAe,CAAC,EAAE,KAAK,GACtB,QAAQ,CAAC,MAAM,CAAC,CA4ClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAY5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAY7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,IAAI,CAYN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EACtC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,IAAI,CAYN"}
|
|
@@ -12,20 +12,20 @@ import { RoomShape } from "isaac-typescript-definitions";
|
|
|
12
12
|
*
|
|
13
13
|
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
|
|
14
14
|
*/
|
|
15
|
-
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector
|
|
15
|
+
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Readonly<Vector>;
|
|
16
16
|
/**
|
|
17
17
|
* Helper function to convert a grid index to a grid position.
|
|
18
18
|
*
|
|
19
19
|
* For example, in a 1x1 room, grid index 0 is equal to "Vector(-1, -1) and grid index 16 is equal
|
|
20
20
|
* to "Vector(0, 0)".
|
|
21
21
|
*/
|
|
22
|
-
export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Vector
|
|
22
|
+
export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Readonly<Vector>;
|
|
23
23
|
/**
|
|
24
24
|
* Helper function to convert a grid position `Vector` to a world position `Vector`.
|
|
25
25
|
*
|
|
26
26
|
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
|
|
27
27
|
*/
|
|
28
|
-
export declare function gridPositionToWorldPosition(gridPosition: Vector): Vector
|
|
28
|
+
export declare function gridPositionToWorldPosition(gridPosition: Vector): Readonly<Vector>;
|
|
29
29
|
/**
|
|
30
30
|
* Test if a grid position is actually in the given `RoomShape`.
|
|
31
31
|
*
|
|
@@ -37,7 +37,7 @@ export declare function isValidGridPosition(gridPosition: Vector, roomShape: Roo
|
|
|
37
37
|
*
|
|
38
38
|
* In this context, the grid position of the top-left wall is "Vector(-1, -1)".
|
|
39
39
|
*/
|
|
40
|
-
export declare function worldPositionToGridPosition(worldPos: Vector): Vector
|
|
40
|
+
export declare function worldPositionToGridPosition(worldPos: Vector): Readonly<Vector>;
|
|
41
41
|
/**
|
|
42
42
|
* Helper function to convert a world position `Vector` to a grid position `Vector`.
|
|
43
43
|
*
|
|
@@ -45,5 +45,5 @@ export declare function worldPositionToGridPosition(worldPos: Vector): Vector;
|
|
|
45
45
|
*
|
|
46
46
|
* This is similar to the `worldPositionToGridPosition` function, but the values are not rounded.
|
|
47
47
|
*/
|
|
48
|
-
export declare function worldPositionToGridPositionFast(worldPos: Vector): Vector
|
|
48
|
+
export declare function worldPositionToGridPositionFast(worldPos: Vector): Readonly<Vector>;
|
|
49
49
|
//# sourceMappingURL=roomGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/roomGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAUzD;;;;GAIG;AACH,wBAAgB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"roomGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/roomGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAUzD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,CAAC,EAAE,GAAG,EACN,CAAC,EAAE,GAAG,GACL,QAAQ,CAAC,MAAM,CAAC,CAGlB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,SAAS,GACnB,QAAQ,CAAC,MAAM,CAAC,CAMlB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,GACnB,QAAQ,CAAC,MAAM,CAAC,CAKlB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,SAAS,GACnB,OAAO,CAIT;AA0BD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,GACf,QAAQ,CAAC,MAAM,CAAC,CAIlB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,GACf,QAAQ,CAAC,MAAM,CAAC,CAIlB"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - If the user does not have a HUD offset configured, this function will return `Vector(0, 0)`.
|
|
12
12
|
* - If the user has a HUD offset of 1.0 configured, this function will return `Vector(20, 12)`.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getHUDOffsetVector(): Vector
|
|
14
|
+
export declare function getHUDOffsetVector(): Readonly<Vector>;
|
|
15
15
|
/**
|
|
16
16
|
* Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this
|
|
17
17
|
* function will return 6.
|
|
@@ -23,13 +23,13 @@ export declare function getHeartRowLength(player: EntityPlayer): int;
|
|
|
23
23
|
* combination with the `getHUDOffsetVector` helper function.
|
|
24
24
|
*/
|
|
25
25
|
export declare function getHeartsUIWidth(): int;
|
|
26
|
-
export declare function getScreenBottomCenterPos(): Vector
|
|
27
|
-
export declare function getScreenBottomLeftPos(): Vector
|
|
28
|
-
export declare function getScreenBottomRightPos(): Vector
|
|
29
|
-
export declare function getScreenCenterPos(): Vector
|
|
30
|
-
export declare function getScreenTopCenterPos(): Vector
|
|
31
|
-
export declare function getScreenTopLeftPos(): Vector
|
|
32
|
-
export declare function getScreenTopRightPos(): Vector
|
|
26
|
+
export declare function getScreenBottomCenterPos(): Readonly<Vector>;
|
|
27
|
+
export declare function getScreenBottomLeftPos(): Readonly<Vector>;
|
|
28
|
+
export declare function getScreenBottomRightPos(): Readonly<Vector>;
|
|
29
|
+
export declare function getScreenCenterPos(): Readonly<Vector>;
|
|
30
|
+
export declare function getScreenTopCenterPos(): Readonly<Vector>;
|
|
31
|
+
export declare function getScreenTopLeftPos(): Readonly<Vector>;
|
|
32
|
+
export declare function getScreenTopRightPos(): Readonly<Vector>;
|
|
33
33
|
/**
|
|
34
34
|
* Get how many hearts are currently being shown on the hearts UI.
|
|
35
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/functions/ui.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/functions/ui.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAmBrD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAU3D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAgCtC;AAED,wBAAgB,wBAAwB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAG3D;AAED,wBAAgB,sBAAsB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAGzD;AAED,wBAAgB,uBAAuB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAK1D;AAED,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAGrD;AAED,wBAAgB,qBAAqB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAGxD;AAED,wBAAgB,mBAAmB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAEtD;AAED,wBAAgB,oBAAoB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAGvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAa1D"}
|
|
@@ -33,7 +33,7 @@ export declare function doesVectorHaveLength(vector: Vector, threshold?: number)
|
|
|
33
33
|
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
34
34
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
35
35
|
*/
|
|
36
|
-
export declare function getRandomVector(seedOrRNG?: Seed | RNG): Vector
|
|
36
|
+
export declare function getRandomVector(seedOrRNG?: Seed | RNG): Readonly<Vector>;
|
|
37
37
|
/**
|
|
38
38
|
* Used to determine is the given table is a serialized `Vector` object created by the `deepCopy`
|
|
39
39
|
* function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/functions/vector.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,yBAAyB,EACzB,SAAS,EACV,MAAM,8BAA8B,CAAC;AAatC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,MAAM,CAAC;CACnD,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAqBlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,SAAO,GACf,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,MAAM,
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/functions/vector.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,yBAAyB,EACzB,SAAS,EACV,MAAM,8BAA8B,CAAC;AAatC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,MAAM,CAAC;CACnD,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAqBlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,SAAO,GACf,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,QAAQ,CAAC,MAAM,CAAC,CAOlB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gBAAgB,CAM5B;AAED,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAWhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,MAAM,CAIpE"}
|
package/package.json
CHANGED
package/src/functions/color.ts
CHANGED
|
@@ -87,7 +87,7 @@ export function deserializeColor(color: SerializedColor): Color {
|
|
|
87
87
|
export function getRandomColor(
|
|
88
88
|
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
89
89
|
alpha = 1,
|
|
90
|
-
): Color {
|
|
90
|
+
): Readonly<Color> {
|
|
91
91
|
const rng = isRNG(seedOrRNG) ? seedOrRNG : newRNG(seedOrRNG);
|
|
92
92
|
|
|
93
93
|
const r = getRandom(rng);
|
package/src/functions/hex.ts
CHANGED
|
@@ -8,7 +8,7 @@ const HEX_STRING_LENGTH = 6;
|
|
|
8
8
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
9
9
|
* @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
|
|
10
10
|
*/
|
|
11
|
-
export function hexToColor(hexString: string, alpha = 1.0): Color {
|
|
11
|
+
export function hexToColor(hexString: string, alpha = 1.0): Readonly<Color> {
|
|
12
12
|
const [r, g, b] = hexToRGB(hexString);
|
|
13
13
|
|
|
14
14
|
// Color values should be between 0 and 1.
|
|
@@ -22,7 +22,7 @@ export function hexToColor(hexString: string, alpha = 1.0): Color {
|
|
|
22
22
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
23
23
|
* @param alpha Range is from 0 to 1. Default is 1.
|
|
24
24
|
*/
|
|
25
|
-
export function hexToKColor(hexString: string, alpha = 1.0): KColor {
|
|
25
|
+
export function hexToKColor(hexString: string, alpha = 1.0): Readonly<KColor> {
|
|
26
26
|
const [r, g, b] = hexToRGB(hexString);
|
|
27
27
|
|
|
28
28
|
// KColor values should be between 0 and 1.
|
package/src/functions/kColor.ts
CHANGED
|
@@ -76,7 +76,7 @@ export function deserializeKColor(kColor: SerializedKColor): KColor {
|
|
|
76
76
|
export function getRandomKColor(
|
|
77
77
|
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
78
78
|
alpha = 1,
|
|
79
|
-
): KColor {
|
|
79
|
+
): Readonly<KColor> {
|
|
80
80
|
const rng = isRNG(seedOrRNG) ? seedOrRNG : newRNG(seedOrRNG);
|
|
81
81
|
|
|
82
82
|
const r = getRandom(rng);
|
package/src/functions/log.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isNumber } from "./types";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Helper function to get the name and the line number of the current calling function.
|
|
3
5
|
*
|
|
@@ -53,9 +55,13 @@ export function getParentFunctionDescription(
|
|
|
53
55
|
*/
|
|
54
56
|
export function log(
|
|
55
57
|
this: void,
|
|
56
|
-
msg: string,
|
|
58
|
+
msg: string | number,
|
|
57
59
|
includeParentFunction = true,
|
|
58
60
|
): void {
|
|
61
|
+
if (isNumber(msg)) {
|
|
62
|
+
msg = msg.toString();
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
const parentFunctionDescription = includeParentFunction
|
|
60
66
|
? getParentFunctionDescription()
|
|
61
67
|
: undefined;
|
|
@@ -54,7 +54,7 @@ export function findFreePosition(
|
|
|
54
54
|
startingPosition: Vector,
|
|
55
55
|
avoidActiveEntities = false,
|
|
56
56
|
minimumDistance?: float,
|
|
57
|
-
): Vector {
|
|
57
|
+
): Readonly<Vector> {
|
|
58
58
|
const room = game.GetRoom();
|
|
59
59
|
const heavenDoors = getEffects(
|
|
60
60
|
EffectVariant.HEAVEN_LIGHT_DOOR,
|