From 0b66fdbdfdde166eb4eb07816c6449ba2d7040ec Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 5 May 2019 04:26:23 -0500 Subject: [PATCH] fix: explicit types for minification --- common/combat/alive.trait.js | 4 ++++ common/combat/damaging.trait.js | 4 ++++ common/combat/vulnerable.trait.js | 4 ++++ common/traits/controllable.trait.js | 4 ++++ common/traits/darkened.trait.js | 4 ++++ server/traits/informed.trait.js | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/common/combat/alive.trait.js b/common/combat/alive.trait.js index adc727e..0aa5296 100644 --- a/common/combat/alive.trait.js +++ b/common/combat/alive.trait.js @@ -55,6 +55,10 @@ export class Alive extends decorate(Trait) { }; } + static type() { + return 'alive'; + } + initialize() { this._context = createContext(); this._context.add('entity', this.entity); diff --git a/common/combat/damaging.trait.js b/common/combat/damaging.trait.js index a77fb83..4df5960 100644 --- a/common/combat/damaging.trait.js +++ b/common/combat/damaging.trait.js @@ -13,6 +13,10 @@ export class Damaging extends Trait { }; } + static type() { + return 'damaging'; + } + initialize() { this._collidingWith = []; const damageSpecsJSON = this.params.damageSpecs; diff --git a/common/combat/vulnerable.trait.js b/common/combat/vulnerable.trait.js index 542d8d3..fe7e4a0 100644 --- a/common/combat/vulnerable.trait.js +++ b/common/combat/vulnerable.trait.js @@ -34,6 +34,10 @@ export class Vulnerable extends Trait { } } + static type() { + return 'vulnerable'; + } + initialize() { this.damageId = 0; this._hasAddedEmitter = false; diff --git a/common/traits/controllable.trait.js b/common/traits/controllable.trait.js index bbbb6db..e6c104d 100644 --- a/common/traits/controllable.trait.js +++ b/common/traits/controllable.trait.js @@ -5,6 +5,10 @@ import {Trait} from '@avocado/entity'; // Input handling. export class Controllable extends Trait { + static type() { + return 'controllable'; + } + initialize() { this._inputState = I.Map(); } diff --git a/common/traits/darkened.trait.js b/common/traits/darkened.trait.js index 2d7d6ef..e5099b4 100644 --- a/common/traits/darkened.trait.js +++ b/common/traits/darkened.trait.js @@ -9,6 +9,10 @@ export class Darkened extends Trait { }; } + static type() { + return 'darkened'; + } + initialize() { this._isDarkened = this.params.isDarkened; } diff --git a/server/traits/informed.trait.js b/server/traits/informed.trait.js index 6afa8b1..5fad675 100644 --- a/server/traits/informed.trait.js +++ b/server/traits/informed.trait.js @@ -18,6 +18,10 @@ const decorate = compose( export class Informed extends decorate(Trait) { + static type() { + return 'informed'; + } + initialize() { this._packer = new Packer(); this._rememberedEntities = {};