Encapsulate DB.js in angular constants to help testing

This commit is contained in:
Colin McLeod
2015-05-04 21:54:36 -07:00
parent c297bb6e8e
commit bf04a2cc19
8 changed files with 14 additions and 12 deletions

View File

@@ -117,7 +117,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
Ship.prototype.useBulkhead = function(index) {
this.bulkheads.id = index;
this.bulkheads.c = DB.components.bulkheads[this.id][index];
this.bulkheads.c = Components.bulkheads(this.id, index);
this.updateTotals(); // Update mass, range, shield strength, armor
}