mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2026-01-18 23:56:15 -08:00
Modified the file structure to have the `index.html` at the root of the repository. Needed for Github Pages.
21 lines
596 B
JavaScript
21 lines
596 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 "Invalid sequence selection.";
|
|
}
|
|
}
|