Slight Adjustments, Added Fuels Output

This commit is contained in:
Neshura 2024-05-22 23:37:44 +02:00
parent 42628b6a57
commit f85faeb6ad
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
3 changed files with 89 additions and 30 deletions

View file

@ -1,6 +1,7 @@
import {Thruster, THRUSTER_LIST} from "$lib/thruster.svelte";
import {Thruster, THRUSTER_LIST, THRUSTER_TYPE_LIST} from "$lib/thruster.svelte";
import {Grid} from "$lib/grid";
import {INVENTORIES, Inventory} from "$lib/containers.svelte";
import type {Fuel} from "$lib/fuel";
export class Ship {
thrusters: Array<Thruster> = $state([]);
@ -91,4 +92,14 @@ export class Ship {
});
return thrust;
}
getFuelTypes(): Array<Fuel> {
let fuels: Array<Fuel> = [];
this.thrusters.forEach((thruster) => {
if (!fuels.includes(thruster.details.type.details.fuel)) {
fuels.push(thruster.details.type.details.fuel)
}
})
return fuels;
}
}