@antha/entity-2d 0.12.0 → 0.13.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.
package/dist/entity.d.ts CHANGED
@@ -153,6 +153,8 @@ export declare class EntityStore2d<State extends AnyObject = any> {
153
153
  deserializeEntity(entityKey: string, serializedParams: string | undefined): Promise<BaseEntity2d>;
154
154
  /** Create a new instance of the given entity class and add it to this entity store. */
155
155
  addEntity<const NewEntityConstructor extends Entity2dConstructor>(entityClass: NewEntityConstructor, ...params: AddEntity2dParams<NoInfer<NewEntityConstructor>>): Promise<InstanceType<NewEntityConstructor>>;
156
+ /** Immediately destroys every current entity while leaving the entity store usable. */
157
+ destroyAllEntities(): void;
156
158
  /** Destroys the entity store and all entities contained inside it. */
157
159
  destroy(): void;
158
160
  }
package/dist/entity.js CHANGED
@@ -282,6 +282,13 @@ export class EntityStore2d {
282
282
  this.entityInstanceMap.add(child);
283
283
  return child;
284
284
  }
285
+ /** Immediately destroys every current entity while leaving the entity store usable. */
286
+ destroyAllEntities() {
287
+ if (this.isDestroyed) {
288
+ throw new Error('Cannot operate on a destroyed entity store.');
289
+ }
290
+ this.currentEntityInstances.forEach((entity) => entity.immediatelyDestroy());
291
+ }
285
292
  /** Destroys the entity store and all entities contained inside it. */
286
293
  destroy() {
287
294
  if (this.isDestroyed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/entity-2d",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "An Antha mod for handling 2D entities.",
5
5
  "keywords": [
6
6
  "vir",
@@ -39,8 +39,8 @@
39
39
  "@augment-vir/common": "^32.2.3"
40
40
  },
41
41
  "devDependencies": {
42
- "@antha/engine": "^0.12.0",
43
- "@antha/web-test-runner-plugin-pixi": "^0.12.0",
42
+ "@antha/engine": "^0.13.0",
43
+ "@antha/web-test-runner-plugin-pixi": "^0.13.0",
44
44
  "@augment-vir/test": "^32.2.3",
45
45
  "@web/dev-server-esbuild": "^2.0.0",
46
46
  "@web/test-runner": "^1.0.0",
@@ -52,10 +52,10 @@
52
52
  "typed-event-target": "^4.3.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@antha/asset": "^0.12.0",
56
- "@antha/audio": "^0.12.0",
57
- "@antha/engine": "^0.12.0",
58
- "@antha/graphics-2d": "^0.12.0",
55
+ "@antha/asset": "^0.13.0",
56
+ "@antha/audio": "^0.13.0",
57
+ "@antha/engine": "^0.13.0",
58
+ "@antha/graphics-2d": "^0.13.0",
59
59
  "detect-collisions": ">=10",
60
60
  "element-vir": ">=26",
61
61
  "object-shape-tester": ">=6",