mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2025-12-24 20:10:10 -08:00
- Reimplemented 2D orbital mechanics functions in physics-2d.ts and encaspulated inside a `Physics2D` namespace. - Deleted physics.ts and moved the required functions into physics-3d.ts Further cleaning and reimplemntation will be done on the physics-3d.ts content. - Forced consistency on error handling : every raised error throws an `Error` object. - Commented sections relative to 2D physics and sequence generation.
21 lines
607 B
JavaScript
21 lines
607 B
JavaScript
import { Selector } from "./selector.js";
|
|
export class SequenceSelector extends Selector {
|
|
constructor(id) {
|
|
super(id);
|
|
this.sequences = [];
|
|
}
|
|
fillFrom(sequences) {
|
|
this.sequences = sequences;
|
|
const strs = this.sequences.map(seq => seq.seqString);
|
|
this.fill(strs);
|
|
}
|
|
get sequence() {
|
|
const selectedString = this._selector.value;
|
|
for (const sequence of this.sequences) {
|
|
if (sequence.seqString == selectedString)
|
|
return sequence;
|
|
}
|
|
throw new Error("Invalid sequence selection.");
|
|
}
|
|
}
|