@benev/archimedes 0.1.0-6 → 0.1.0-7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benev/archimedes",
3
- "version": "0.1.0-6",
3
+ "version": "0.1.0-7",
4
4
  "description": "game ecs with auto networking",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,14 +17,13 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@e280/renraku": "^0.5.7",
20
- "@e280/stz": "^0.2.30",
20
+ "@e280/stz": "^0.2.32",
21
21
  "@msgpack/msgpack": "^3.1.3",
22
22
  "sparrow-rtc": "^0.2.15"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@e280/octo": "^0.1.0",
26
26
  "@e280/science": "^0.1.10",
27
- "npm-run-all": "^4.1.5",
28
27
  "typescript": "^6.0.2"
29
28
  },
30
29
  "author": "Chase Moskal <chasemoskal@gmail.com>",
@@ -16,7 +16,7 @@ export function lifecycle<C extends Components, K extends keyof C>(
16
16
  // add fresh entities
17
17
  for (const [id, components] of entities.select(...componentKeys)) {
18
18
  const callbacks = alive.guarantee(id, () => enter(id, components))
19
- callbacks.tick(id, components)
19
+ callbacks.tick(components)
20
20
  }
21
21
 
22
22
  // delete stale entities
@@ -24,7 +24,7 @@ export function lifecycle<C extends Components, K extends keyof C>(
24
24
  for (const [id, callbacks] of alive) {
25
25
  if (currentIds.has(id)) continue
26
26
  alive.delete(id)
27
- callbacks.exit(id)
27
+ callbacks.exit()
28
28
  }
29
29
  }
30
30
  }
@@ -16,8 +16,8 @@ export type Systems<C extends Components> = (change: Change<C>) => (() => void)[
16
16
  export const asSystems = <C extends Components>(systems: Systems<C>) => systems
17
17
 
18
18
  export type LifecycleCallbacks<C extends Components, K extends keyof C> = {
19
- tick: (id: Id, components: Select<C, K>) => void
20
- exit: (id: Id) => void
19
+ tick: (components: Select<C, K>) => void
20
+ exit: () => void
21
21
  }
22
22
 
23
23
  export type LifecycleEnter<C extends Components, K extends keyof C> = (
@@ -5,7 +5,7 @@ export function lifecycle(entities, componentKeys, enter) {
5
5
  // add fresh entities
6
6
  for (const [id, components] of entities.select(...componentKeys)) {
7
7
  const callbacks = alive.guarantee(id, () => enter(id, components));
8
- callbacks.tick(id, components);
8
+ callbacks.tick(components);
9
9
  }
10
10
  // delete stale entities
11
11
  const currentIds = new Set([...entities.select(...componentKeys)].map(([id]) => id));
@@ -13,7 +13,7 @@ export function lifecycle(entities, componentKeys, enter) {
13
13
  if (currentIds.has(id))
14
14
  continue;
15
15
  alive.delete(id);
16
- callbacks.exit(id);
16
+ callbacks.exit();
17
17
  }
18
18
  };
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../s/ecs/parts/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAI9B,MAAM,UAAU,SAAS,CACvB,QAA6B,EAC7B,aAAkB,EAClB,KAA2B;IAG5B,MAAM,KAAK,GAAG,IAAI,IAAI,EAAgC,CAAA;IAEtD,OAAO,GAAG,EAAE;QAEX,qBAAqB;QACrB,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC;YAClE,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAA;YAClE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/B,CAAC;QAED,wBAAwB;QACxB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,C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CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAChB,SAAS,CAAC,IAAI,EAAE,CAAA;QACjB,CAAC;IACF,CAAC,CAAA;AACF,CAAC"}
@@ -15,7 +15,7 @@ export type Delta<C extends Components> = DeltaSet<C> | DeltaMerge<C> | DeltaDro
15
15
  export type Systems<C extends Components> = (change: Change<C>) => (() => void)[];
16
16
  export declare const asSystems: <C extends Components>(systems: Systems<C>) => Systems<C>;
17
17
  export type LifecycleCallbacks<C extends Components, K extends keyof C> = {
18
- tick: (id: Id, components: Select<C, K>) => void;
19
- exit: (id: Id) => void;
18
+ tick: (components: Select<C, K>) => void;
19
+ exit: () => void;
20
20
  };
21
21
  export type LifecycleEnter<C extends Components, K extends keyof C> = ((id: Id, components: Select<C, K>) => LifecycleCallbacks<C, K>);