Skip to content

Commit

Permalink
Added debug method to TYPECALC
Browse files Browse the repository at this point in the history
  • Loading branch information
agarie committed May 8, 2012
1 parent 646da42 commit 6b72da3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
typeCalc
Author: Carlos Agarie
Author URL: http://onox.com.br
Version: 0.1
License: MIT License
Version: 0.1

INTRODUCTION
============
Expand Down
28 changes: 18 additions & 10 deletions src/typecalc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,29 @@ var TYPECALC = {
calc: {},
engine: {},
calculate: function () {
var t = this;
var team = [], weaks = [], count = {};

// Implementation of the calc steps
$("#calculate").click(function () {

team = t.io.walkTheTeam();
console.log(team);
weaks = t.calc.weaknesses(team);
console.log(weaks);
count = t.calc.reduceWeaknesses(weaks);
console.log(count);
t.io.showResultsOnUi("Resists: " + count.resistCount.toString() + "<br />", true);
t.io.showResultsOnUi("Weaknesses: " + count.weaknessCount.toString(), false);
});
team = TYPECALC.io.walkTheTeam();
weaks = TYPECALC.calc.weaknesses(team);
count = TYPECALC.calc.reduceWeaknesses(weaks);
TYPECALC.io.showResultsOnUi("Resists: " + count.resistCount.toString() + "<br />", true);
TYPECALC.io.showResultsOnUi("Weaknesses: " + count.weaknessCount.toString(), false);
});
},
debug: function () {
var results = [];
var team = [], weaks = [], count = {};

team = TYPECALC.io.walkTheTeam();
weaks = TYPECALC.calc.weaknesses(team);
count = TYPECALC.calc.reduceWeaknesses(weaks);

console.log(team);
console.log(weaks);
console.log(count);
}
};

Expand Down

0 comments on commit 6b72da3

Please sign in to comment.