mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2025-12-12 15:49:59 -08:00
Modified the file structure to have the `index.html` at the root of the repository. Needed for Github Pages.
18 lines
516 B
JavaScript
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;
|
|
}
|
|
}
|