feat: layered and roomed
This commit is contained in:
parent
91dccd9329
commit
5616f3275b
24
packages/entity/traits/layered.js
Normal file
24
packages/entity/traits/layered.js
Normal 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');
|
||||
}
|
||||
|
||||
}
|
||||
|
23
packages/entity/traits/roomed.js
Normal file
23
packages/entity/traits/roomed.js
Normal 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');
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user