@rbxts/covenant 1.5.1 → 1.5.3
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
CHANGED
package/src/covenant.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Entity, Id } from "@rbxts/jecs";
|
|
2
2
|
import { CovenantHooks, Discriminator } from "./hooks";
|
|
3
3
|
import { Remove, Delete } from "./stringEnums";
|
|
4
|
+
export * from "@rbxts/jecs";
|
|
4
5
|
export type WorldChangesForReplication = Map<string, Delete | Map<string, defined | Remove>>;
|
|
5
6
|
export type WorldChangesForPrediction = Map<string, Map<string, defined | Remove>>;
|
|
6
7
|
export interface CovenantProps {
|
|
@@ -78,4 +79,3 @@ export declare class Covenant {
|
|
|
78
79
|
worldGet<T extends [Id] | [Id, Id] | [Id, Id, Id] | [Id, Id, Id, Id]>(entity: Entity, ...components: T): import("@rbxts/jecs").FlattenTuple<[...import("@rbxts/jecs").Nullable<import("@rbxts/jecs").InferComponents<T>>]>;
|
|
79
80
|
worldContains(entity: Entity): boolean;
|
|
80
81
|
}
|
|
81
|
-
export {};
|
package/src/covenant.luau
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
3
4
|
local _jecs = TS.import(script, TS.getModule(script, "@rbxts", "jecs").jecs)
|
|
4
5
|
local ChildOf = _jecs.ChildOf
|
|
5
6
|
local pair = _jecs.pair
|
|
@@ -15,6 +16,9 @@ local _helpers = TS.import(script, script.Parent, "helpers")
|
|
|
15
16
|
local compareMaps = _helpers.compareMaps
|
|
16
17
|
local turnSetWithIdentifierToMap = _helpers.turnSetWithIdentifierToMap
|
|
17
18
|
local EventMap = TS.import(script, script.Parent, "dataStructureWithEvents").EventMap
|
|
19
|
+
for _k, _v in TS.import(script, TS.getModule(script, "@rbxts", "jecs").jecs) or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
18
22
|
-- Map<Entity, Delete | Map<Component, state | Remove>>
|
|
19
23
|
-- Map<Component, Map<Entity, state | Remove>>
|
|
20
24
|
local function createWorldWithRange(minClientEntity, maxClientEntity)
|
|
@@ -865,6 +869,5 @@ do
|
|
|
865
869
|
return self._world:contains(entity)
|
|
866
870
|
end
|
|
867
871
|
end
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
872
|
+
exports.Covenant = Covenant
|
|
873
|
+
return exports
|
|
@@ -17,7 +17,7 @@ export declare class EventMapWithInstance<T extends defined> {
|
|
|
17
17
|
set(instance: Instance, key: RBXScriptSignal, value: T): this;
|
|
18
18
|
delete(instance: Instance, key: RBXScriptSignal): boolean;
|
|
19
19
|
clear(): void;
|
|
20
|
-
|
|
20
|
+
deleteInstance(instance: Instance): boolean;
|
|
21
21
|
isEmpty(): boolean;
|
|
22
22
|
isInstanceEmpty(instance: Instance): boolean;
|
|
23
23
|
forEach(callbackfn: (value: T, key: RBXScriptSignal) => void): void;
|
|
@@ -114,6 +114,9 @@ do
|
|
|
114
114
|
local _instance_1 = instance
|
|
115
115
|
local _eventMap = eventMap
|
|
116
116
|
_instanceEventMaps_1[_instance_1] = _eventMap
|
|
117
|
+
instance.Destroying:Once(function()
|
|
118
|
+
self:deleteInstance(instance)
|
|
119
|
+
end)
|
|
117
120
|
end
|
|
118
121
|
eventMap:set(key, value)
|
|
119
122
|
return self
|
|
@@ -130,7 +133,7 @@ do
|
|
|
130
133
|
function EventMapWithInstance:clear()
|
|
131
134
|
table.clear(self.instanceEventMaps)
|
|
132
135
|
end
|
|
133
|
-
function EventMapWithInstance:
|
|
136
|
+
function EventMapWithInstance:deleteInstance(instance)
|
|
134
137
|
local _instanceEventMaps = self.instanceEventMaps
|
|
135
138
|
local _instance = instance
|
|
136
139
|
-- ▼ Map.delete ▼
|
|
@@ -285,6 +288,9 @@ do
|
|
|
285
288
|
local _instance_1 = instance
|
|
286
289
|
local _eventSet = eventSet
|
|
287
290
|
_instanceEventSets_1[_instance_1] = _eventSet
|
|
291
|
+
instance.Destroying:Once(function()
|
|
292
|
+
self:deleteInstance(instance)
|
|
293
|
+
end)
|
|
288
294
|
end
|
|
289
295
|
eventSet:add(value)
|
|
290
296
|
return self
|