aotds-docks/src/components/Carrier/index.svelte

38 lines
824 B
Svelte
Raw Normal View History

2020-07-27 17:42:19 +00:00
<Section label="carrier">
<ShipItem {cost} {mass} >
<Field label="bays">
<input type="number" min="0" bind:value={bays} />
</Field>
</ShipItem>
{#each squadrons as squad (squad.id)}
2021-05-17 13:48:31 +00:00
<Squadron {...squad} />
2020-07-27 17:42:19 +00:00
{/each}
</Section>
<script>
import {getContext } 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 Squadron from './Squadron/index.svelte';
import dux from '../../dux/carrier';
2020-07-27 17:42:19 +00:00
2021-05-17 13:48:31 +00:00
export let bays = 0;
2020-07-27 17:42:19 +00:00
export let squadrons = [];
export let cost = 0;
export let mass = 0;
export let ship_change = getContext('ship_change') || ( () => {} );
$: ship_change( dux.actions.set_carrier_bays(bays) );
</script>
<style>
div {
background-color: red;
}
</style>