feat: layered and roomed

This commit is contained in:
cha0s 2019-03-27 01:03:05 -05:00
parent 91dccd9329
commit 5616f3275b
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import {Trait} from '@avocado/entity';
export class Layered extends Trait {
initialize() {
this._layer = undefined;
}
destroy() {
delete this._layer;
this.entity.emit('removedFromLayer');
}
get layer() {
return this._layer;
}
set layer(layer) {
this._layer = layer;
this.entity.emit('addedToLayer');
}
}

View File

@ -0,0 +1,23 @@
import {Trait} from '@avocado/entity';
export class Roomed extends Trait {
initialize() {
this._room = undefined;
}
destroy() {
delete this._room;
this.entity.emit('removedFromRoom');
}
get room() {
return this._room;
}
set room(room) {
this._room = room;
this.entity.emit('addedToRoom');
}
}