aotds-docks/src/components/Hull.svelte

43 lines
830 B
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-19 20:21:28 +00:00
</Section>
<script>
import { createEventDispatcher } from 'svelte';
import Section from '~C/Section';
import Field from '~C/Field';
import ShipItem from '~C/ShipItem';
import Screens from './Screens';
2020-07-26 21:55:51 +00:00
import Armour from './Armour';
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
);
let min, max;
$: min = Math.ceil(ship_mass / 10);
$: max = ship_mass;
const dispatch = createEventDispatcher();
$: dispatch( 'change_hull', { rating } );
</script>
<style>
</style>