refactor: no nasty params
This commit is contained in:
parent
6d169ad5f4
commit
f2dba0a801
|
@ -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));
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user