refactor: Entity::[hasTrait -> is]

This commit is contained in:
cha0s 2019-03-23 18:49:19 -05:00
parent f123d12624
commit 151ca214e0
3 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class Entity extends decorate(Resource) {
return this;
}
hasTrait(type) {
is(type) {
return this.traits_PRIVATE.hasTrait(type);
}

View File

@ -103,7 +103,7 @@ class EntityListBase {
delete this.entities_PRIVATE[uuid];
this.state_PRIVATE = this.state_PRIVATE.delete(uuid);
this.emit('entityRemoved', entity);
if (entity.hasTrait('listed')) {
if (entity.is('listed')) {
entity.removeTrait('listed');
}
}

View File

@ -49,7 +49,7 @@ class MobileBase extends Trait {
if (Vector.isZero(this.requestedMovement)) {
return;
}
if (this.entity.hasTrait('physical')) {
if (this.entity.is('physical')) {
this.entity.applyImpulse(this.requestedMovement);
}
else {