armor print

main
Yanick Champoux 2022-03-26 12:15:02 -04:00
parent 74d0317580
commit 9ecea73c44
5 changed files with 51 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<div class="layers">
{#each armour as layer (layer)}
{#each armor as layer,i (i)}
<div class="layer">
{#each _.range(layer.rating) as i (i)}
{#each Array.from({length: layer}) as j}
<div class="cell" />
{/each}
</div>
@ -11,9 +11,9 @@
<script>
import _ from "lodash";
export let armour = [];
export let armor = [];
console.log(armor)
$: console.log(armour);
</script>
<style>

View File

@ -0,0 +1,22 @@
<Meta title="Output/Print/Structure/Armor" component={Armor} argTypes={{
armor: {
type: 'object',
defaultValue: [2,4],
}
}} />
<Story name="Primary" args={{}} />
<Template let:args>
<div style="width: 50em">
<Armor {...args} />
</div>
</Template>
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Armor from './Armor.svelte';
</script>

View File

@ -1,6 +1,10 @@
<div>
<Identification {...$state.identification} />
<div class="section-2">
<Hull structure={$state.structure} shipMass={$state.identification.mass} />
</div>
<Weapons weapons={$state.weaponry.weapons} />
<MainSystems ftl={$state?.propulsion?.ftl}
@ -28,7 +32,7 @@ import { getContext } from 'svelte';
import Identification from "./Identification/index.svelte";
import MainSystems from "./MainSystems/index.svelte";
/* import Hull from "./Hull/index.svelte"; */
import Hull from "./Hull/index.svelte";
import Weapons from "./Weapons/index.svelte";
/* import Systems from "./Systems/index.svelte"; */

View File

@ -1,4 +1,9 @@
<Meta title="ShipEdit/Carrier" component={Carrier} argTypes={{}} />
<Meta title="ShipEdit/Carrier" component={Carrier} argTypes={{
armor: {
type: 'object',
defaultValue: [2,4],
}
}} />
<Story name="Primary" args={{}} />

View File

@ -3,6 +3,20 @@ import u from "updeep";
import reqs from "../reqs.js";
const schema = {
type: 'object',
properties: {
reqs: { type: 'object', properties: {
cost: { type: 'number' },
mass: { type: 'number' },
} },
layers: { type: 'array', items: 'number' }
},
examples: [
{ reqs: { cost: 5, mass: 5 }, layers: [2,4 ] }
]
}
const dux = new Updux({
subduxes: {
reqs,