refactor: Entity::[hasTrait -> is]
This commit is contained in:
parent
f123d12624
commit
151ca214e0
|
@ -81,7 +81,7 @@ class Entity extends decorate(Resource) {
|
|||
return this;
|
||||
}
|
||||
|
||||
hasTrait(type) {
|
||||
is(type) {
|
||||
return this.traits_PRIVATE.hasTrait(type);
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user