Skip to content

Commit

Permalink
Add formatting options for actual Pokémon stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Cu3PO42 committed Aug 13, 2015
1 parent 2843ad2 commit cd9856c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
22 changes: 20 additions & 2 deletions app/elements/pkm-list/pkm-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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];
Expand Down
22 changes: 20 additions & 2 deletions app/elements/pkm-list/pkm-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit cd9856c

Please sign in to comment.