@rbxts/covenant 3.1.1 → 3.2.1
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/package.json +1 -1
- package/src/covenant.d.ts +1 -0
- package/src/covenant.luau +29 -30
package/package.json
CHANGED
package/src/covenant.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class Covenant {
|
|
|
20
20
|
private systems;
|
|
21
21
|
private worldChangesForReplication;
|
|
22
22
|
private worldChangesForPrediction;
|
|
23
|
+
private components;
|
|
23
24
|
private undefinedStringifiedComponents;
|
|
24
25
|
private replicatedStringifiedComponents;
|
|
25
26
|
private predictedStringifiedComponents;
|
package/src/covenant.luau
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
|
-
local
|
|
5
|
-
local ChildOf = _jecs.ChildOf
|
|
6
|
-
local pair = _jecs.pair
|
|
7
|
-
local world = _jecs.world
|
|
4
|
+
local world = TS.import(script, TS.getModule(script, "@rbxts", "jecs").jecs).world
|
|
8
5
|
local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
|
|
9
6
|
local Players = _services.Players
|
|
10
7
|
local RunService = _services.RunService
|
|
@@ -44,6 +41,7 @@ do
|
|
|
44
41
|
self.systems = EventMap.new()
|
|
45
42
|
self.worldChangesForReplication = {}
|
|
46
43
|
self.worldChangesForPrediction = {}
|
|
44
|
+
self.components = {}
|
|
47
45
|
self.undefinedStringifiedComponents = {}
|
|
48
46
|
self.replicatedStringifiedComponents = {}
|
|
49
47
|
self.predictedStringifiedComponents = {}
|
|
@@ -476,36 +474,35 @@ do
|
|
|
476
474
|
if not self:worldContains(entity) then
|
|
477
475
|
return nil
|
|
478
476
|
end
|
|
479
|
-
local
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
477
|
+
local _exp = self.components
|
|
478
|
+
-- ▼ ReadonlyArray.forEach ▼
|
|
479
|
+
local _callback = function(c)
|
|
480
|
+
if self:worldHas(c) then
|
|
481
|
+
local _stringifiedComponentSubscribers = self.stringifiedComponentSubscribers
|
|
482
|
+
local _arg0 = tostring(c)
|
|
483
|
+
local _result = _stringifiedComponentSubscribers[_arg0]
|
|
484
|
+
if _result ~= nil then
|
|
485
|
+
-- ▼ ReadonlySet.forEach ▼
|
|
486
|
+
local _callback_1 = function(subscriber)
|
|
487
|
+
subscriber(entity, nil, self:worldGet(entity, c))
|
|
488
|
+
end
|
|
489
|
+
for _v in _result do
|
|
490
|
+
_callback_1(_v, _v, _result)
|
|
491
|
+
end
|
|
492
|
+
-- ▲ ReadonlySet.forEach ▲
|
|
493
|
+
end
|
|
494
494
|
end
|
|
495
495
|
end
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
self._world:delete(entityToDelete)
|
|
499
|
-
if RunService:IsServer() then
|
|
500
|
-
local _worldChangesForReplication = self.worldChangesForReplication
|
|
501
|
-
local _arg0 = tostring(entityToDelete)
|
|
502
|
-
_worldChangesForReplication[_arg0] = Delete
|
|
503
|
-
end
|
|
496
|
+
for _k, _v in _exp do
|
|
497
|
+
_callback(_v, _k - 1, _exp)
|
|
504
498
|
end
|
|
505
|
-
|
|
506
|
-
|
|
499
|
+
-- ▲ ReadonlyArray.forEach ▲
|
|
500
|
+
self._world:delete(entity)
|
|
501
|
+
if RunService:IsServer() then
|
|
502
|
+
local _worldChangesForReplication = self.worldChangesForReplication
|
|
503
|
+
local _arg0 = tostring(entity)
|
|
504
|
+
_worldChangesForReplication[_arg0] = Delete
|
|
507
505
|
end
|
|
508
|
-
-- ▲ ReadonlySet.forEach ▲
|
|
509
506
|
end
|
|
510
507
|
function Covenant:worldComponent()
|
|
511
508
|
self:preventPostStartCall()
|
|
@@ -513,6 +510,8 @@ do
|
|
|
513
510
|
local _undefinedStringifiedComponents = self.undefinedStringifiedComponents
|
|
514
511
|
local _arg0 = tostring(c)
|
|
515
512
|
_undefinedStringifiedComponents[_arg0] = true
|
|
513
|
+
local _exp = self.components
|
|
514
|
+
table.insert(_exp, c)
|
|
516
515
|
if RunService:IsStudio() and self.logging then
|
|
517
516
|
print(`{(debug.info(2, "sl"))}:{c}`)
|
|
518
517
|
end
|