diff --git a/app/elements/pkm-list/pkm-list.js b/app/elements/pkm-list/pkm-list.js index 8a60e958..78f7b881 100644 --- a/app/elements/pkm-list/pkm-list.js +++ b/app/elements/pkm-list/pkm-list.js @@ -22,7 +22,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { var handlebars = require("handlebars"); var fs = require("fs"); var localization = require("keysavcore/Localization"); -var calculateLevel = require("keysavcore/level"); +var StatCalculator = require("keysavcore/Calculator"); var remote = require("remote"); var IpcClient = require("electron-ipc-tunnel/client"); var path = require("path-extra"); @@ -71,7 +71,25 @@ handlebars.registerHelper(require("handlebars-helper-moment")()); return this.box + 1; }, level: function () { - return calculateLevel(this.species, this.exp); + return StatCalculator.level(this); + }, + hp: function () { + return StatCalculator.hp(this); + }, + atk: function () { + return StatCalculator.atk(this); + }, + def: function () { + return StatCalculator.def(this); + }, + spAtk: function () { + return StatCalculator.spAtk(this); + }, + spDef: function () { + return StatCalculator.spDef(this); + }, + spe: function () { + return StatCalculator.spe(this); }, speciesName: function () { return localization[self.language].species[this.species]; diff --git a/app/elements/pkm-list/pkm-list.ts b/app/elements/pkm-list/pkm-list.ts index 65029b57..42a50a30 100644 --- a/app/elements/pkm-list/pkm-list.ts +++ b/app/elements/pkm-list/pkm-list.ts @@ -7,7 +7,7 @@ import handlebars = require("handlebars"); import fs = require("fs"); import localization = require("keysavcore/Localization"); -import calculateLevel = require("keysavcore/level"); +import StatCalculator = require("keysavcore/Calculator"); import remote = require("remote"); import IpcClient = require("electron-ipc-tunnel/client"); import path = require("path-extra"); @@ -95,7 +95,25 @@ class PkmList extends polymer.Base { return this.box+1; }, level: function() { - return calculateLevel(this.species, this.exp); + return StatCalculator.level(this); + }, + hp: function() { + return StatCalculator.hp(this); + }, + atk: function() { + return StatCalculator.atk(this); + }, + def: function() { + return StatCalculator.def(this); + }, + spAtk: function() { + return StatCalculator.spAtk(this); + }, + spDef: function() { + return StatCalculator.spDef(this); + }, + spe: function() { + return StatCalculator.spe(this); }, speciesName: function() { return localization[self.language].species[this.species];