diff --git a/packages/entity/list.js b/packages/entity/list.js index 6852053..286e57d 100644 --- a/packages/entity/list.js +++ b/packages/entity/list.js @@ -57,11 +57,8 @@ class EntityListBase { const uuid = entity.instanceUuid; this.entities_PRIVATE[uuid] = entity; this.state_PRIVATE = this.state_PRIVATE.set(uuid, entity.state()); - entity.addTrait('listed', { - params: { - list: this, - }, - }); + entity.addTrait('listed'); + entity.list = this; const onEntityPositionChanged = () => { this.quadTree_PRIVATE.remove(this.quadTreePoint(entity)); this.quadTree_PRIVATE.add(this.recomputeQuadTreePoint(entity)); diff --git a/packages/entity/traits/listed.js b/packages/entity/traits/listed.js index 7269b97..0446b28 100644 --- a/packages/entity/traits/listed.js +++ b/packages/entity/traits/listed.js @@ -6,8 +6,6 @@ import {Rectangle, Vector} from '@avocado/math'; export class Listed extends Trait { initialize() { - this._list = this.params.get('list'); - this.params = this.params.delete('list'); this.lastNearby = I.Set(); } @@ -15,6 +13,10 @@ export class Listed extends Trait { return this._list; } + set list(list) { + this._list = list; + } + methods() { return {