@ecsframework/core 0.0.1 → 0.0.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/flamework.build +47 -0
- package/out/framework/base-system.d.ts +1 -0
- package/out/framework/base-system.luau +3 -0
- package/out/framework/index.d.ts +2 -0
- package/out/framework/init.luau +10 -0
- package/out/framework/systems/roblox-instance-system.luau +3 -0
- package/out/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -4
package/flamework.build
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flameworkVersion": "1.3.1",
|
|
4
|
+
"identifiers": {
|
|
5
|
+
"@ecsframework/core:out/framework/base-system@BaseSystem": "$ecsframework:core:framework/base-system@BaseSystem",
|
|
6
|
+
"@ecsframework/core:out/framework/dependencies-container@DependenciesContainer": "$ecsframework:core:framework/dependencies-container@DependenciesContainer",
|
|
7
|
+
"@ecsframework/core:out/framework/init@ECSFramework": "$ecsframework:core:framework/init@ECSFramework",
|
|
8
|
+
"@ecsframework/core:out/framework/components/roblox-instance-component@RobloxInstanceComponent": "$ecsframework:core:framework/components/roblox-instance-component@RobloxInstanceComponent",
|
|
9
|
+
"@ecsframework/core:out/framework/decorators/component@ECSComponent": "$ecsframework:core:framework/decorators/component@ECSComponent",
|
|
10
|
+
"@ecsframework/core:out/framework/systems/roblox-instance-system@RobloxInstanceSystem": "$ecsframework:core:framework/systems/roblox-instance-system@RobloxInstanceSystem",
|
|
11
|
+
"@ecsframework/core:out/framework/decorators/system@ECSSystem": "$ecsframework:core:framework/decorators/system@ECSSystem",
|
|
12
|
+
"@ecsframework/core:out/framework/flamecs/registry@ChildOf": "$ecsframework:core:framework/flamecs/registry@ChildOf",
|
|
13
|
+
"@ecsframework/core:out/framework/flamecs/registry@Wildcard": "$ecsframework:core:framework/flamecs/registry@Wildcard",
|
|
14
|
+
"@ecsframework/core:out/framework/components/destroyed-component@DestroyComponent": "$ecsframework:core:framework/components/destroyed-component@DestroyComponent",
|
|
15
|
+
"@ecsframework/core:out/framework/decorators/inject-type@InjectType": "$ecsframework:core:framework/decorators/inject-type@InjectType",
|
|
16
|
+
"@ecsframework/core:out/framework/decorators/tagged@TaggedInstance": "$ecsframework:core:framework/decorators/tagged@TaggedInstance"
|
|
17
|
+
},
|
|
18
|
+
"metadata": {},
|
|
19
|
+
"identifierPrefix": "$ecsframework:core",
|
|
20
|
+
"classes": [
|
|
21
|
+
{
|
|
22
|
+
"filePath": "out\\framework\\base-system.lua",
|
|
23
|
+
"internalId": "$ecsframework:core:framework/base-system@BaseSystem",
|
|
24
|
+
"decorators": []
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"filePath": "out\\framework\\components\\roblox-instance-component.lua",
|
|
28
|
+
"internalId": "$ecsframework:core:framework/components/roblox-instance-component@RobloxInstanceComponent",
|
|
29
|
+
"decorators": [
|
|
30
|
+
{
|
|
31
|
+
"internalId": "$ecsframework:core:framework/decorators/component@ECSComponent",
|
|
32
|
+
"name": "ECSComponent"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"filePath": "out\\framework\\systems\\roblox-instance-system.lua",
|
|
38
|
+
"internalId": "$ecsframework:core:framework/systems/roblox-instance-system@RobloxInstanceSystem",
|
|
39
|
+
"decorators": [
|
|
40
|
+
{
|
|
41
|
+
"internalId": "$ecsframework:core:framework/decorators/system@ECSSystem",
|
|
42
|
+
"name": "ECSSystem"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -196,6 +196,7 @@ export declare abstract class BaseSystem {
|
|
|
196
196
|
*/
|
|
197
197
|
ParentComponent(entity: Entity): Entity | undefined;
|
|
198
198
|
GetAllClassComponents(): Constructor[];
|
|
199
|
+
GetComponentKeyByName(name: string): string | undefined;
|
|
199
200
|
/** @metadata macro */
|
|
200
201
|
GetClassComponent<T>(key?: ComponentKey<T>): Constructor;
|
|
201
202
|
/**
|
|
@@ -85,6 +85,9 @@ do
|
|
|
85
85
|
function BaseSystem:GetAllClassComponents()
|
|
86
86
|
return Reflect.getOwnMetadata(getmetatable(self), "ECSFramework:Components") or ({})
|
|
87
87
|
end
|
|
88
|
+
function BaseSystem:GetComponentKeyByName(name)
|
|
89
|
+
return self.framework:GetComponentKeyByName(name)
|
|
90
|
+
end
|
|
88
91
|
function BaseSystem:GetClassComponent(key)
|
|
89
92
|
local _componentsMap = self.framework.componentsMap
|
|
90
93
|
local _key = key
|
package/out/framework/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class ECSFramework {
|
|
|
9
9
|
private isStarted;
|
|
10
10
|
private baseSystemCtor;
|
|
11
11
|
readonly componentsMap: ReadonlyMap<string, Constructor>;
|
|
12
|
+
readonly ComponentsByName: ReadonlyMap<string, string>;
|
|
12
13
|
private components;
|
|
13
14
|
private world;
|
|
14
15
|
readonly signals: {
|
|
@@ -18,6 +19,7 @@ export declare class ECSFramework {
|
|
|
18
19
|
};
|
|
19
20
|
constructor(container?: DependenciesContainer);
|
|
20
21
|
GetAllComponents(): Constructor[];
|
|
22
|
+
GetComponentKeyByName(name: string): string | undefined;
|
|
21
23
|
private initSystems;
|
|
22
24
|
private invokeStartup;
|
|
23
25
|
private initUpdate;
|
package/out/framework/init.luau
CHANGED
|
@@ -39,6 +39,7 @@ do
|
|
|
39
39
|
self.canCallEffect = true
|
|
40
40
|
self.isStarted = false
|
|
41
41
|
self.componentsMap = {}
|
|
42
|
+
self.ComponentsByName = {}
|
|
42
43
|
self.components = {}
|
|
43
44
|
self.signals = {
|
|
44
45
|
added = {},
|
|
@@ -86,6 +87,10 @@ do
|
|
|
86
87
|
local _arg0 = GetIdentifier(ctor)
|
|
87
88
|
local _ctor = ctor
|
|
88
89
|
_exp[_arg0] = _ctor
|
|
90
|
+
local _exp_1 = (self.ComponentsByName)
|
|
91
|
+
local _arg0_1 = `{ctor}`
|
|
92
|
+
local _arg1 = GetIdentifier(ctor)
|
|
93
|
+
_exp_1[_arg0_1] = _arg1
|
|
89
94
|
return ctor
|
|
90
95
|
end
|
|
91
96
|
for _k, _v in _result do
|
|
@@ -118,6 +123,11 @@ do
|
|
|
118
123
|
self.components = _condition
|
|
119
124
|
return self.components
|
|
120
125
|
end
|
|
126
|
+
function ECSFramework:GetComponentKeyByName(name)
|
|
127
|
+
local _componentsByName = self.ComponentsByName
|
|
128
|
+
local _name = name
|
|
129
|
+
return _componentsByName[_name]
|
|
130
|
+
end
|
|
121
131
|
function ECSFramework:initSystems()
|
|
122
132
|
local systems = Reflect.getMetadata(self.baseSystemCtor, "ECSFramework:Systems") or {}
|
|
123
133
|
local _exp = self.container:InstantiateGroup(systems, true)
|
|
@@ -29,6 +29,9 @@ do
|
|
|
29
29
|
end
|
|
30
30
|
function RobloxInstanceSystem:OnStartup()
|
|
31
31
|
self:Added("$ecsframework:core:framework/components/roblox-instance-component@RobloxInstanceComponent"):connect(function(entity, data)
|
|
32
|
+
if data.Instance:GetAttribute(INSTANCE_ATTRIBUTE_ENTITY_ID) ~= nil then
|
|
33
|
+
error("Instance already has an entity")
|
|
34
|
+
end
|
|
32
35
|
data.Instance:SetAttribute(INSTANCE_ATTRIBUTE_ENTITY_ID, entity)
|
|
33
36
|
end)
|
|
34
37
|
self:Removed("$ecsframework:core:framework/components/roblox-instance-component@RobloxInstanceComponent"):connect(function(entity)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../node_modules/@rbxts/t/lib/t.d.ts","../node_modules/@flamework/core/out/modding.d.ts","../node_modules/@flamework/core/out/utility.d.ts","../node_modules/@flamework/core/out/reflect.d.ts","../node_modules/@flamework/core/out/flamework.d.ts","../node_modules/@flamework/core/out/index.d.ts","../node_modules/@rbxts/jecs/jecs.d.ts","../node_modules/@rbxts/services/index.d.ts","../src/framework/flamecs/signal.ts","../src/framework/flamecs/registry.ts","../src/framework/flamecs/query.ts","../src/framework/flamecs/topo.ts","../src/framework/flamecs/index.ts","../src/framework/components/destroyed-component.ts","../src/framework/decorators/inject-type.ts","../src/framework/utilities.ts","../src/framework/hooks/query-change.ts","../node_modules/@rbxts/immut/src/none.d.ts","../node_modules/@rbxts/immut/src/makedraftsafe.d.ts","../node_modules/@rbxts/immut/src/makedraftsafereadonly.d.ts","../node_modules/@rbxts/immut/src/table.d.ts","../node_modules/@rbxts/immut/src/types-internal.d.ts","../node_modules/@rbxts/immut/src/types-external.d.ts","../node_modules/@rbxts/immut/src/index.d.ts","../src/framework/base-system.ts","../src/framework/decorators/component.ts","../src/framework/decorators/system.ts","../src/framework/dependencies-container.ts","../src/framework/index.ts","../src/framework/decorators/unaffectable.ts","../src/framework/decorators/tagged.ts","../src/framework/components/roblox-instance-component.ts","../src/framework/systems/roblox-instance-system.ts","../src/framework/hooks/use-added.ts","../src/framework/hooks/use-removed.ts","../src/framework/hooks/use-changed.ts","../src/framework/hooks/use-event.ts","../src/framework/hooks/use-throttle.ts","../src/index.ts","../node_modules/@rbxts/types/include/generated/enums.d.ts","../node_modules/@rbxts/types/include/generated/none.d.ts","../node_modules/@rbxts/types/include/lua.d.ts","../node_modules/@rbxts/types/include/macro_math.d.ts","../node_modules/@rbxts/types/include/roblox.d.ts","../node_modules/@rbxts/compiler-types/types/array.d.ts","../node_modules/@rbxts/compiler-types/types/callmacros.d.ts","../node_modules/@rbxts/compiler-types/types/iterable.d.ts","../node_modules/@rbxts/compiler-types/types/map.d.ts","../node_modules/@rbxts/compiler-types/types/promise.d.ts","../node_modules/@rbxts/compiler-types/types/set.d.ts","../node_modules/@rbxts/compiler-types/types/string.d.ts","../node_modules/@rbxts/compiler-types/types/symbol.d.ts","../node_modules/@rbxts/compiler-types/types/typeutils.d.ts","../node_modules/@rbxts/compiler-types/types/eslintignore.d.ts","../node_modules/@rbxts/compiler-types/types/core.d.ts","../node_modules/@rbxts/maid/maid.d.ts","../node_modules/@rbxts/object-utils/index.d.ts","../node_modules/@rbxts/signal/index.d.ts"],"fileInfos":[{"version":"429178068cb844a452dad87eb0a7a02466f3509fff9e7f1187fdb0595e66b8df","signature":false},{"version":"f984bb5cbefabad3e6279516673ca0cb2098304225cfe61987f2af81daf3f99a","signature":false},{"version":"5ed7aeb5909b9e1607087690870addc6df2d3d7e6e3e16f389fe21da53915526","signature":false},{"version":"1fe834c2d906a0d49917ce932bb495bfbb58912d49ad6b03f66ae0be14ad9def","signature":false},{"version":"99709374cb8bf64c65dad5350c88a805af91e107545e18af91e4839d4336a441","signature":false},{"version":"a1a226a8d6b1039d7d0613381c2f4dec614c30305cf96ee973cc49973d9745e4","signature":false},{"version":"1f0f6e103444aad5f544988f7a8390e351b30481ce6eac8ad7765911c56dda6e","signature":false},{"version":"9e6c13e0c00f23d1e9a40e4652ef4e604bdf6747feab7d7b7ca66b5d6bcfa330","signature":false},{"version":"cff894ef201eb519e33e59b861ceb3766076e4f371734218d331157a3b307a11","signature":false},{"version":"7657c1313842d36462d213e5928c6629265b50a75a85e03750526b5c21989539","signature":false},{"version":"cf75483180e62aa81e878d688cdd40b6d86b120cd84ea4acff735b13c9a81406","signature":false},{"version":"c2b615b7c60bf38930966af14e64cc1ef33ed23ba0a77bdd8ea09fdc4f5e2683","signature":false},{"version":"3800f61fdda8762cb1f766f6badbc560a94853c8c6a21b67d8e0f746eb15926c","signature":false},{"version":"a3adf1732167824c54869e10749d1d5529167a6dbe6fca946e572fb871d40779","signature":false},{"version":"474d1e2b04aa20949db0906e4276c1ef878bd4dfa5213d671a8fc57581b5d48f","signature":false},{"version":"21c94b01e64ef3b58e18d8e2d6abc3386d6e1b2e472371d055fa867ab377957f","signature":false},{"version":"c67f3177e7a5c943c698bae2aa595bdfdbb0d683d0ca22247099bf21ac8ae048","signature":false},{"version":"d9d14150234c32bc0bf772d69182b166d8de600e0e5207924867da19351aca53","signature":false},{"version":"1a73eb921b7aa92d4c2d86ec95a39f5f73cf170b939314394d1b87bd06ae707b","signature":false},{"version":"5e5db3fb2f4f1a4d5276b9ba8f78df1f5f73754eeae5e2c23028f7830a2b66f9","signature":false},{"version":"3a36f6c843d1b4e91f80d6ff3ef8b5e25e1948fae24b8c62631c5df1faf82e41","signature":false},{"version":"dba94b73dbbe23c5066eeafc9f4f8dbf4430a4ab73d2d0d251fe4c1cd029d90b","signature":false},{"version":"564a52d0f974d976d982a2385ac5b353329f2dadab4f7616ee303678a7f64134","signature":false},{"version":"ff329383f830b2ba7578f67a374e2b8077f0b3d7036bf4d1a24edcc95de45c5d","signature":false},{"version":"0d63a7403329c24e3b65a9d4ba0aca38405a72c650d941197714af04d910ecca","signature":false},{"version":"cc0ae0a75e9b0d16fa7c2d9888620647e292e4b63426fc5f2d5f51ac485d3ba1","signature":false},{"version":"afa4bcb1c950e70212cc4ccf83a6096a25bc4280fb03bf94157f2eea853fad15","signature":false},{"version":"9de935bc7b10c7ed9ef9b7cd6a701dcb94cbaa2276aea7db2c2c0913a5f02435","signature":false},{"version":"d151c91439d38955eb809a6723a43d4d82c9bb902ea6bfb88e9a5ac50bbcf42f","signature":false},{"version":"531c125862ac8e801bca17eaacc89b21e0d49ef80a76bf7dbd09b006f3e27a4a","signature":false},{"version":"a338d29a41283825142277b6a19d02abaeb3a7e854ebdb9d139d98edaab35cf7","signature":false},{"version":"be4e6ec9fe788d72a70afbdc4c297ea31d842a9ea301559f5ca42cdf13db1383","signature":false},{"version":"8f8a346e85be36e3163376b6f282eeafcdb89b04531d99f7f6a85c490e63710d","signature":false},{"version":"8d1395d7fa6381cf71368706cf815130a32895fddd44acb047751072801f90bb","signature":false},{"version":"cdeedec78d8c66fc7522d13e9a2150edda98b18fd3bb95d0f556b6678d0c3739","signature":false},{"version":"7e8bf6cb0c7e13b34a8b40c4b36e633d639b8c4a3b5dec3a55a08bf26caf9a6b","signature":false},{"version":"27b0c41f2f485e59eaaab0d65c192ca022d7fcea87b2c24c9405a91e8b7a4a79","signature":false},{"version":"20d034b52037a7e5b0268fde45a111ffa9f0ae2e04819549d677262711d9dcf2","signature":false},{"version":"83ff055cf857b5dfc99a762213fffc995ec4dd1c91d797523b8fdf65068256df","signature":false},{"version":"6eb7fae75c4a1a6bdee1d48700000f43f9d5cff7987f08bd49f21ed1ac0b7c4b","signature":false,"affectsGlobalScope":true},{"version":"3a5626be0c9a1aae6f75d0d38bcea4d070e5d1381a843a9b4eafd3eab6ed7ef7","signature":false,"affectsGlobalScope":true},{"version":"f6c97e5b3403d6f8683372fff53430b8d93728a60f04623bd3de9e470fe71259","signature":false,"affectsGlobalScope":true},{"version":"bfb3f3bd1d89a54d975a7554c8d12209188d7b849d00b9345fd0d41d79858e38","signature":false,"affectsGlobalScope":true},{"version":"22f424c221d557a69d83386550a272558bfef6f81b1dbacd3d35b4651b128d2b","signature":false,"affectsGlobalScope":true},{"version":"d1461f750f98ba938cf3b43f1095774f6007b92a4550bbfde87451dccc32b3bd","signature":false,"affectsGlobalScope":true},{"version":"c30a7a2198451431d80de5f9ba7197a0c8a56d52b29373e7270115776a28f3f3","signature":false,"affectsGlobalScope":true},{"version":"d4d6595aca02f63e2107a842fdd8f79e147fd802acd0e60900f16bee4f861173","signature":false,"affectsGlobalScope":true},{"version":"2070e277f4e874747a7706f000f19f2f512f9829f65f4caf634a908c07f45117","signature":false,"affectsGlobalScope":true},{"version":"7f53343307db666fa6a82bf5165f961d4b70e268ffb7e4e108f06d953c10c679","signature":false,"affectsGlobalScope":true},{"version":"8d10b5097dc2692979a984b4c56deaa0ad77c3a7b036a066ea0a72ec8c514830","signature":false,"affectsGlobalScope":true},{"version":"a252fd9c3a3e55eab45c1c78d376e7a8d82e736d55a5d95a1b285290881d5f88","signature":false,"affectsGlobalScope":true},{"version":"dde6ecc6409a17b372382192ca43c78c52015f34f49547ead38194c63127793a","signature":false,"affectsGlobalScope":true},{"version":"ed7b23f234388de62c9f86bcecd4608a854067fc20f2b4698b9f14ce0d92f4f2","signature":false,"affectsGlobalScope":true},{"version":"85ce7d3110c6652c276ea4d027bc1887176d97a5b7494f288cbbdfb2b48a11ee","signature":false,"affectsGlobalScope":true},{"version":"52535c5f6ea63e76c537e39df77b0720827e3f8d0fac9e2386352f0b6110a211","signature":false,"affectsGlobalScope":true},{"version":"abfe7c34c18ff9a242d5b7e4aba61dfb14b2db55ce5edce1798aaae365fa9cfe","signature":false},{"version":"7b9707d4934d0b63c71920058db2bd6f815b90c4ace1100ea24915c14c9af895","signature":false},{"version":"f73b1d7270a91ed30c71075ee5e0472465931a37ecdb5834c9d8ebe828847b45","signature":false}],"root":[[9,17],[25,39]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"downlevelIteration":true,"experimentalDecorators":true,"jsx":2,"module":1,"outDir":"./","rootDir":"../src","strict":true,"target":99,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[1,2,3],[2,4,5],[1,3],[3],[2],[44],[44,45,46,47,48,49,50,51,52,53,54],[18,21,22,23],[19,20],[22],[40,44],[41,55],[40,41,42,43,55],[3,6,7,9,10,13,14,15,17,23,24,29],[13],[26],[6,7,16,25],[1,6],[3,6,16,25],[3,7,13,16,28],[6],[3,6,15,16],[10,11,12],[7,10],[6,7,9],[7,25],[6,7,10,13,14,16],[6,10,13,16],[6,13],[3,6,7,8,9,10,13,16,25,26,27,28],[7,8,10,15,16,25,27,28,31,32],[3,6,7,8,10,13],[6,13,14,15,16,17,25,26,27,29,30,31,32,33,34,35,36,37,38]],"referencedMap":[[5,1],[6,2],[2,3],[4,4],[3,5],[45,6],[46,6],[55,7],[54,6],[47,6],[48,6],[49,6],[50,6],[51,6],[52,6],[53,6],[24,8],[21,9],[23,10],[40,6],[41,11],[42,12],[44,13],[25,14],[14,15],[32,16],[26,17],[15,18],[27,19],[31,20],[30,21],[28,22],[13,23],[11,24],[10,25],[12,26],[17,27],[34,28],[36,28],[37,29],[35,28],[38,29],[29,30],[33,31],[16,32],[39,33]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58]},"version":"5.5.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecsframework/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "out/init.lua",
|
|
6
6
|
"scripts": {
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"types": "out/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
18
|
"out",
|
|
19
|
-
"
|
|
20
|
-
"!**/*.spec.lua"
|
|
19
|
+
"flamework.build"
|
|
21
20
|
],
|
|
22
21
|
"publishConfig": {
|
|
23
22
|
"access": "public"
|
|
@@ -37,11 +36,11 @@
|
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@rbxts/immut": "^0.4.4-ts.0",
|
|
40
|
-
"@rbxts/jecs": "^0.9.0-rc.10",
|
|
41
39
|
"@rbxts/services": "^1.5.5",
|
|
42
40
|
"@rbxts/signal": "^1.1.1"
|
|
43
41
|
},
|
|
44
42
|
"peerDependencies": {
|
|
43
|
+
"@rbxts/jecs": ">=0.9.0-rc.10",
|
|
45
44
|
"@flamework/core": "*",
|
|
46
45
|
"rbxts-transformer-flamework": "*"
|
|
47
46
|
}
|