Version URLs to handle changes to ship specifications over time

This commit is contained in:
Cmdr McDonald
2016-12-14 13:23:54 +00:00
parent 5bbc6be3d8
commit 5603315bf0
4 changed files with 49 additions and 7 deletions

View File

@@ -61,6 +61,7 @@ export default class OutfittingPage extends Page {
let params = context.route.params;
let shipId = params.ship;
let code = params.code;
let version = params.ver;
let buildName = params.bn;
let data = Ships[shipId]; // Retrieve the basic ship properties, slots and defaults
let savedCode = Persist.getBuild(shipId, buildName);
@@ -72,7 +73,7 @@ export default class OutfittingPage extends Page {
let ship = new Ship(shipId, data.properties, data.slots); // Create a new Ship instance
if (code) {
ship.buildFrom(code); // Populate modules from serialized 'code' URL param
ship.buildFrom(code, version); // Populate modules from serialized 'code' URL param
} else {
ship.buildWith(data.defaults); // Populate with default components
}