@draug/engine 1.0.20 → 1.0.23

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.
@@ -0,0 +1,37 @@
1
+ import {
2
+ System,
3
+ SystemBase,
4
+ Transform,
5
+ Velocity,
6
+ __decorateClass
7
+ } from "./chunk-SWTBVK53.js";
8
+
9
+ // src/std/systems/movement.ts
10
+ var MovementSystem = class extends SystemBase {
11
+ transformStore;
12
+ velocityStore;
13
+ onInit(ctx) {
14
+ this.transformStore = ctx.world.components.getStorage(Transform);
15
+ this.velocityStore = ctx.world.components.getStorage(Velocity);
16
+ }
17
+ compute(ctx) {
18
+ for (const id of ctx.entities) {
19
+ const t = this.transformStore.tryGet(id);
20
+ const v = this.velocityStore.tryGet(id);
21
+ t.position.add(v.linear);
22
+ }
23
+ }
24
+ };
25
+ MovementSystem = __decorateClass([
26
+ System({
27
+ name: "MovementSystem_stdlib",
28
+ query: {
29
+ include: [Transform, Velocity]
30
+ }
31
+ })
32
+ ], MovementSystem);
33
+
34
+ export {
35
+ MovementSystem
36
+ };
37
+ //# sourceMappingURL=chunk-BYP45ZLQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/std/systems/movement.ts"],"sourcesContent":["import type { ComponentStorage } from \"../../ecs/components\";\nimport { System, SystemBase, type SystemComputeContext, type SystemInitContext } from \"../../ecs/system\";\nimport { Transform, Velocity } from \"../components\";\n\n@System({\n name: \"MovementSystem_stdlib\",\n query: {\n include: [Transform, Velocity]\n },\n})\nexport class MovementSystem extends SystemBase {\n private transformStore!: ComponentStorage<Transform>;\n private velocityStore!: ComponentStorage<Velocity>;\n public onInit(ctx: SystemInitContext): void {\n this.transformStore = ctx.world.components.getStorage(Transform);\n this.velocityStore = ctx.world.components.getStorage(Velocity);\n }\n public compute(ctx: SystemComputeContext): void {\n for(const id of ctx.entities) {\n const t = this.transformStore.tryGet(id);\n const v = this.velocityStore.tryGet(id);\n t.position.add(v.linear);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAUO,IAAM,iBAAN,cAA6B,WAAW;AAAA,EACnC;AAAA,EACA;AAAA,EACD,OAAO,KAA8B;AACxC,SAAK,iBAAiB,IAAI,MAAM,WAAW,WAAW,SAAS;AAC/D,SAAK,gBAAgB,IAAI,MAAM,WAAW,WAAW,QAAQ;AAAA,EACjE;AAAA,EACO,QAAQ,KAAiC;AAC5C,eAAU,MAAM,IAAI,UAAU;AAC1B,YAAM,IAAI,KAAK,eAAe,OAAO,EAAE;AACvC,YAAM,IAAI,KAAK,cAAc,OAAO,EAAE;AACtC,QAAE,SAAS,IAAI,EAAE,MAAM;AAAA,IAC3B;AAAA,EACJ;AACJ;AAda,iBAAN;AAAA,EANN,OAAO;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,MACH,SAAS,CAAC,WAAW,QAAQ;AAAA,IACjC;AAAA,EACJ,CAAC;AAAA,GACY;","names":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkGUD2YACAcjs = require('./chunk-GUD2YACA.cjs');
8
+
9
+ // src/std/systems/movement.ts
10
+ var MovementSystem = class extends _chunkGUD2YACAcjs.SystemBase {
11
+
12
+
13
+ onInit(ctx) {
14
+ this.transformStore = ctx.world.components.getStorage(_chunkGUD2YACAcjs.Transform);
15
+ this.velocityStore = ctx.world.components.getStorage(_chunkGUD2YACAcjs.Velocity);
16
+ }
17
+ compute(ctx) {
18
+ for (const id of ctx.entities) {
19
+ const t = this.transformStore.tryGet(id);
20
+ const v = this.velocityStore.tryGet(id);
21
+ t.position.add(v.linear);
22
+ }
23
+ }
24
+ };
25
+ MovementSystem = exports.MovementSystem = _chunkGUD2YACAcjs.__decorateClass.call(void 0, [
26
+ _chunkGUD2YACAcjs.System.call(void 0, {
27
+ name: "MovementSystem_stdlib",
28
+ query: {
29
+ include: [_chunkGUD2YACAcjs.Transform, _chunkGUD2YACAcjs.Velocity]
30
+ }
31
+ })
32
+ ], MovementSystem);
33
+
34
+
35
+
36
+ exports.MovementSystem = MovementSystem;
37
+ //# sourceMappingURL=chunk-CNBFO5GJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/eugene/my_web_game_draft/game/packages/engine/dist/chunk-CNBFO5GJ.cjs","../src/std/systems/movement.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACEO,IAAM,eAAA,EAAN,MAAA,QAA6B,6BAAW;AAAA,EACnC;AAAA,EACA;AAAA,EACD,MAAA,CAAO,GAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,eAAA,EAAiB,GAAA,CAAI,KAAA,CAAM,UAAA,CAAW,UAAA,CAAW,2BAAS,CAAA;AAC/D,IAAA,IAAA,CAAK,cAAA,EAAgB,GAAA,CAAI,KAAA,CAAM,UAAA,CAAW,UAAA,CAAW,0BAAQ,CAAA;AAAA,EACjE;AAAA,EACO,OAAA,CAAQ,GAAA,EAAiC;AAC5C,IAAA,IAAA,CAAA,MAAU,GAAA,GAAM,GAAA,CAAI,QAAA,EAAU;AAC1B,MAAA,MAAM,EAAA,EAAI,IAAA,CAAK,cAAA,CAAe,MAAA,CAAO,EAAE,CAAA;AACvC,MAAA,MAAM,EAAA,EAAI,IAAA,CAAK,aAAA,CAAc,MAAA,CAAO,EAAE,CAAA;AACtC,MAAA,CAAA,CAAE,QAAA,CAAS,GAAA,CAAI,CAAA,CAAE,MAAM,CAAA;AAAA,IAC3B;AAAA,EACJ;AACJ,CAAA;AAda,eAAA,2BAAN,+CAAA;AAAA,EANN,sCAAA;AAAO,IACJ,IAAA,EAAM,uBAAA;AAAA,IACN,KAAA,EAAO;AAAA,MACH,OAAA,EAAS,CAAC,2BAAA,EAAW,0BAAQ;AAAA,IACjC;AAAA,EACJ,CAAC;AAAA,CAAA,EACY,cAAA,CAAA;ADsBb;AACA;AACE;AACF,wCAAC","file":"/home/eugene/my_web_game_draft/game/packages/engine/dist/chunk-CNBFO5GJ.cjs","sourcesContent":[null,"import type { ComponentStorage } from \"../../ecs/components\";\nimport { System, SystemBase, type SystemComputeContext, type SystemInitContext } from \"../../ecs/system\";\nimport { Transform, Velocity } from \"../components\";\n\n@System({\n name: \"MovementSystem_stdlib\",\n query: {\n include: [Transform, Velocity]\n },\n})\nexport class MovementSystem extends SystemBase {\n private transformStore!: ComponentStorage<Transform>;\n private velocityStore!: ComponentStorage<Velocity>;\n public onInit(ctx: SystemInitContext): void {\n this.transformStore = ctx.world.components.getStorage(Transform);\n this.velocityStore = ctx.world.components.getStorage(Velocity);\n }\n public compute(ctx: SystemComputeContext): void {\n for(const id of ctx.entities) {\n const t = this.transformStore.tryGet(id);\n const v = this.velocityStore.tryGet(id);\n t.position.add(v.linear);\n }\n }\n}\n"]}