aotds-docks/src/lib/components/Hull/index.svelte

52 lines
1.1 KiB
Svelte
Raw Normal View History

2020-07-19 20:21:28 +00:00
<Section label="hull">
2022-03-01 17:42:33 +00:00
<ShipItem {cost} {mass}>
2020-07-19 20:21:28 +00:00
<Field label="integrity">
2022-03-01 17:42:33 +00:00
<input bind:value={rating} type="number" {min} {max} />
2020-07-19 20:21:28 +00:00
</Field>
2022-03-01 17:42:33 +00:00
</ShipItem>
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
<Screens {...screens} on:set_screens />
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
<Armour {armour} on:ship_change />
2020-07-26 21:55:51 +00:00
2022-03-01 17:42:33 +00:00
<Cargo {...cargo} on:set_cargo />
2020-07-28 19:42:20 +00:00
2022-03-01 17:42:33 +00:00
<Streamlining {...streamlining} />
2020-07-19 20:21:28 +00:00
</Section>
<script>
2022-03-01 17:42:33 +00:00
import { createEventDispatcher } from "svelte";
import Section from "../Section/index.svelte";
import Field from "../Field/index.svelte";
import ShipItem from "../ShipItem/index.svelte";
import Screens from "./Screens/index.svelte";
import Armour from "./Armour/index.svelte";
import Cargo from "./Cargo/index.svelte";
import Streamlining from "./Streamlining/index.svelte";
export let cost,
mass,
ship_mass,
rating,
screens,
armour = (0, 0, 10, 1, [], []);
2020-07-19 20:21:28 +00:00
2020-07-28 19:42:20 +00:00
export let cargo = {};
export let streamlining = {};
2022-03-01 17:42:33 +00:00
let min, max;
2020-07-19 20:21:28 +00:00
$: min = Math.ceil(ship_mass / 10);
$: max = ship_mass;
2022-03-01 17:42:33 +00:00
const dispatch = createEventDispatcher();
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
$: dispatch("change_hull", { rating });
2020-07-19 20:21:28 +00:00
</script>
<style>
2022-03-01 17:42:33 +00:00
input {
width: 5em;
}
2020-07-19 20:21:28 +00:00
</style>