aotds-docks/src/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">
<ShipItem {cost} {mass} >
<Field label="integrity">
<input
bind:value={rating}
type="number" {min} {max} />
</Field>
</ShipItem>
2020-07-24 18:11:18 +00:00
<Screens {...screens} on:set_screens />
2020-07-19 20:21:28 +00:00
2020-07-26 21:55:51 +00:00
<Armour {armour} on:ship_change />
2020-07-28 19:42:20 +00:00
<Cargo {...cargo} on:set_cargo />
<Streamlining {...streamlining} />
2020-07-19 20:21:28 +00:00
</Section>
<script>
import { createEventDispatcher } from 'svelte';
2021-05-17 13:48:31 +00:00
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';
2020-07-19 20:21:28 +00:00
2020-07-26 21:55:51 +00:00
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 = {};
2020-07-19 20:21:28 +00:00
let min, max;
$: min = Math.ceil(ship_mass / 10);
$: max = ship_mass;
const dispatch = createEventDispatcher();
$: dispatch( 'change_hull', { rating } );
</script>
<style>
2020-07-28 18:55:08 +00:00
input { width: 5em; }
2020-07-19 20:21:28 +00:00
</style>