refactor: raw JS params

This commit is contained in:
cha0s 2019-05-04 14:07:16 -05:00
parent dd1000e485
commit 4b7bce35ab
4 changed files with 7 additions and 7 deletions

View File

@ -58,10 +58,10 @@ export class Alive extends decorate(Trait) {
initialize() {
this._context = createContext();
this._context.add('entity', this.entity);
const actionsJSON = this.params.get('deathActions').toJS();
const actionsJSON = this.params.deathActions;
this._deathActions = behaviorItemFromJSON(actionsJSON);
this._deathSound = this.params.get('deathSound');
const conditionJSON = this.params.get('deathCondition').toJS();
this._deathSound = this.params.deathSound;
const conditionJSON = this.params.deathCondition;
this._deathCondition = behaviorItemFromJSON(conditionJSON);
this._isDying = false;
}

View File

@ -15,7 +15,7 @@ export class Damaging extends Trait {
initialize() {
this._collidingWith = [];
const damageSpecsJSON = this.params.get('damageSpecs').toJS();
const damageSpecsJSON = this.params.damageSpecs;
this._damageSpecs = damageSpecsJSON.map((damageSpec) => {
return {
affinity: AFFINITY_PHYSICAL,
@ -25,7 +25,7 @@ export class Damaging extends Trait {
...damageSpec,
};
});
this._damagingSound = this.params.get('damagingSound');
this._damagingSound = this.params.damagingSound;
}
get damageSpecs() {

View File

@ -41,7 +41,7 @@ export class Vulnerable extends Trait {
this._isHydrating = false;
this._isInvulnerable = false;
this.locks = new Map();
const tookDamageActionsJSON = this.params.get('tookDamageActions').toJS();
const tookDamageActionsJSON = this.params.tookDamageActions;
this._tookDamageActions = behaviorItemFromJSON(tookDamageActionsJSON);
this.tookDamageActionsList = [];
}

View File

@ -10,7 +10,7 @@ export class Darkened extends Trait {
}
initialize() {
this._isDarkened = this.params.get('isDarkened');
this._isDarkened = this.params.isDarkened;
}
get isDarkened() {