Bulkhead refactoring

This commit is contained in:
Colin McLeod
2016-03-10 12:29:02 -08:00
parent c3fe0a0cef
commit 15748066c9
7 changed files with 41 additions and 88 deletions

View File

@@ -171,21 +171,6 @@ export function findHardpointId(groupName, clss, rating, name, mount, missile) {
return h ? h.id : 0;
}
/**
* Looks up the bulkhead module for a specific ship and bulkhead
* @param {String} shipId Unique ship Id/Key
* @param {string|number} index Index for the specified bulkhead
* @return {Object} The bulkhead module object
*/
export function bulkheads(shipId, index) {
let bulkhead = Ships[shipId].bulkheads[index];
bulkhead.class = 1;
bulkhead.rating = 'I';
bulkhead.name = BulkheadNames[index];
return bulkhead;
}
/**
* Get the bulkhead index for the given bulkhead name
* @param {String} bulkheadName Bulkhead name in english
@@ -215,7 +200,5 @@ export function isShieldGenerator(g) {
* @return {ModuleSet} The set of modules the ship can install
*/
export function forShip(shipId) {
let ship = Ships[shipId];
let maxInternal = isNaN(ship.slots.internal[0]) ? ship.slots.internal[0].class : ship.slots.internal[0];
return new ModuleSet(Modules, ship.properties.hullMass + 6.5, ship.slots.standard, maxInternal, ship.slots.hardpoints[0]);
return new ModuleSet(Modules, Ships[shipId]);
}