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-19 20:41:49 +00:00
|
|
|
<!--
|
2020-07-19 20:21:28 +00:00
|
|
|
<Screens {screens} on:add_screen />
|
2020-07-19 20:41:49 +00:00
|
|
|
-->
|
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';
|
|
|
|
|
|
|
|
export let cost, mass, ship_mass, rating, screens = (
|
|
|
|
0, 0, 10, 1, []
|
|
|
|
);
|
|
|
|
|
|
|
|
let min, max;
|
|
|
|
$: min = Math.ceil(ship_mass / 10);
|
|
|
|
$: max = ship_mass;
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
|
|
|
$: dispatch( 'change_hull', { rating } );
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|