refactor: no nasty params

This commit is contained in:
cha0s 2019-03-21 00:36:06 -05:00
parent 6d169ad5f4
commit f2dba0a801
2 changed files with 6 additions and 7 deletions

View File

@ -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));

View File

@ -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 {