Files
KSP-MGA-Planner/dist/main/objects/sequence.js
Krafpy 824af087c1 Modified file structure.
Modified the file structure to have the `index.html` at the root
of the repository. Needed for Github Pages.
2021-08-15 21:31:25 +02:00

18 lines
516 B
JavaScript

export class FlybySequence {
constructor(system, ids, cost) {
this.ids = ids;
this.cost = cost;
this.bodies = [];
for (const id of ids) {
this.bodies.push(system.bodyFromId(id));
}
this.length = this.bodies.length;
const getSubstr = (i) => this.bodies[i].name.substring(0, 2);
let str = getSubstr(0);
for (let i = 1; i < this.length; i++) {
str += "-" + getSubstr(i);
}
this.seqString = str;
}
}