@antha/entity-2d 0.0.7 → 0.1.0

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.
@@ -1,6 +1,5 @@
1
- import { type AnyObject } from '@augment-vir/common';
1
+ import { type AnyObject, type Constructor, type IsAny } from '@augment-vir/common';
2
2
  import { type Shape } from 'object-shape-tester';
3
- import { type Constructor, type IsAny } from 'type-fest';
4
3
  import { BaseEntity2d, type BaseEntityAssetDefinitions, type Entity2dConstructorParams, EntityStore2d, type EntityStore2dConstructorParams, type MappedEntityAssets, type ParamsMap, type ReverseParamsMap, ViewEntity2d } from './entity.js';
5
4
  /**
6
5
  * Params for both {@link EntitySuite2d.defineEntity} and {@link EntitySuite2d.defineLogicEntity}.
@@ -1,5 +1,5 @@
1
1
  import { check } from '@augment-vir/assert';
2
- import { getObjectTypedEntries, getOrSet } from '@augment-vir/common';
2
+ import { getObjectTypedEntries, getOrSet, } from '@augment-vir/common';
3
3
  import { BaseEntity2d, EntityStore2d, ViewEntity2d, } from './entity.js';
4
4
  /**
5
5
  * This is the starting point of the @game-vir/entity package. Call this to produce the function
package/dist/entity.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { type Asset, type AssetBulkLoaderLoadOptions, type AssetLoader, type AssetValue } from '@antha/asset';
2
2
  import { type PixiApplication } from '@antha/graphics-2d';
3
- import { ConstructorInstanceMap, type AnyObject, type ExtractKeysWithMatchingValues, type MaybePromise, type PartialWithUndefined } from '@augment-vir/common';
3
+ import { ConstructorInstanceMap, type AbstractConstructor, type AnyObject, type Constructor, type EmptyObject, type ExtractKeysWithMatchingValues, type IsEqual, type IsNever, type MaybePromise, type PartialWithUndefined, type WritableKeysOf } from '@augment-vir/common';
4
4
  import { System as HitboxSystem, type Response as Collision, type Body as Hitbox } from 'detect-collisions';
5
5
  import { type Shape } from 'object-shape-tester';
6
6
  import { type Container, type ViewContainer } from 'pixi.js';
7
- import { type AbstractConstructor, type Constructor, type EmptyObject, type IsEqual, type IsNever, type WritableKeysOf } from 'type-fest';
8
7
  import { GenericListenTarget } from 'typed-event-target';
9
8
  import { type StaticEntity2dParts } from './entity-suite.js';
10
9
  export { System as HitboxSystem, type Response as Collision } from 'detect-collisions';
@@ -322,7 +321,7 @@ export declare abstract class BaseEntity2d<State extends AnyObject = any, Params
322
321
  dispatch(event: EntityEvent | EntityDestroyEvent): void;
323
322
  /** If true, this entity should no longer be used or operated upon. */
324
323
  readonly isDestroyed: boolean;
325
- private readonly abortController;
324
+ protected readonly abortController: AbortController;
326
325
  /** An `AbortSignal` that triggers when the entity is destroyed. */
327
326
  readonly abortSignal: AbortSignal;
328
327
  hitbox: Hitbox<this> | undefined;
@@ -411,7 +410,8 @@ export declare abstract class ViewEntity2d<State extends AnyObject = any, Params
411
410
  /** Creates the view and hitbox, adds the view to the stage, and sets up the params proxy. */
412
411
  initInstance(): Promise<void>;
413
412
  constructor(args: Readonly<Entity2dConstructorParams<NoInfer<State>, NoInfer<Params>>>);
414
- private wrapParamsInProxy;
413
+ /** Wrap entity params in a proxy that maps changes to the view and hitbox properties. */
414
+ protected wrapParamsInProxy(): void;
415
415
  /**
416
416
  * Creates the entity's PixiJS view. This will be called on entity construction and added to the
417
417
  * PixiJS application stage.
package/dist/entity.js CHANGED
@@ -404,6 +404,7 @@ export class ViewEntity2d extends BaseEntity2d {
404
404
  constructor(args) {
405
405
  super(args);
406
406
  }
407
+ /** Wrap entity params in a proxy that maps changes to the view and hitbox properties. */
407
408
  wrapParamsInProxy() {
408
409
  const paramsMap = this.constructor.paramsMap;
409
410
  const reverseParamsMap = this.constructor.reverseParamsMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/entity-2d",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "An Antha mod for handling 2D entities.",
5
5
  "keywords": [
6
6
  "vir",
@@ -35,27 +35,26 @@
35
35
  "test:docs": "virmator docs check"
36
36
  },
37
37
  "dependencies": {
38
- "@augment-vir/assert": "^31.73.1",
39
- "@augment-vir/common": "^31.73.1",
40
- "type-fest": "^5.7.0"
38
+ "@augment-vir/assert": "^32.2.2",
39
+ "@augment-vir/common": "^32.2.2"
41
40
  },
42
41
  "devDependencies": {
43
- "@antha/engine": "^0.0.7",
44
- "@augment-vir/test": "^31.73.1",
45
- "@web/dev-server-esbuild": "^1.0.5",
46
- "@web/test-runner": "^0.20.2",
47
- "@web/test-runner-playwright": "^0.11.1",
42
+ "@antha/engine": "^0.1.0",
43
+ "@antha/web-test-runner-plugin-pixi": "^0.1.0",
44
+ "@augment-vir/test": "^32.2.2",
45
+ "@web/dev-server-esbuild": "^2.0.0",
46
+ "@web/test-runner": "^1.0.0",
47
+ "@web/test-runner-playwright": "^1.0.0",
48
48
  "detect-collisions": "^10.10.2025",
49
49
  "istanbul-smart-text-reporter": "^1.1.5",
50
- "object-shape-tester": "^6.14.0",
50
+ "object-shape-tester": "^6.14.1",
51
51
  "pixi.js": "^8.19.0",
52
- "typed-event-target": "^4.3.1",
53
- "web-test-runner-plugin-pixi": "^0.0.2"
52
+ "typed-event-target": "^4.3.3"
54
53
  },
55
54
  "peerDependencies": {
56
- "@antha/asset": "^0.0.7",
55
+ "@antha/asset": "^0.1.0",
57
56
  "@antha/engine": "*",
58
- "@antha/graphics-2d": "^0.0.7",
57
+ "@antha/graphics-2d": "^0.1.0",
59
58
  "detect-collisions": ">=10",
60
59
  "element-vir": ">=26",
61
60
  "object-shape-tester": ">=6",