diff --git a/src/App.svelte b/src/App.svelte index 512d64a..316fb44 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,7 +3,9 @@ import shipStore from './stores/ship'; + import ShipItem from './components/ShipItem/index.svelte'; import ShipCost from './components/ShipCost.svelte'; + import Field from './components/Field/index.svelte'; import Hull from './components/Hull.svelte'; import Identification from './components/Identification.svelte'; import Firecons from './components/Firecons.svelte'; @@ -11,6 +13,7 @@ import Propulsion from './components/Propulsion/index.svelte'; import Section from '~C/Section'; import Weapon from '~C/Weapon'; + import Cargo from '~C/Cargo/index.svelte'; const ship = shipStore(); @@ -78,6 +81,10 @@ +
+ +
+ diff --git a/src/dux/cargo/index.js b/src/dux/cargo/index.js new file mode 100644 index 0000000..5e2d3f2 --- /dev/null +++ b/src/dux/cargo/index.js @@ -0,0 +1,22 @@ +import Updux from "updux"; +import { action, payload } from "ts-action"; +import u from "updeep"; +import { createSelector } from "reselect"; + +const dux = new Updux({ + initial: { + space: 0, + cost: 0, + mass: 0, + }, +}); + +const set_cargo = action('set_cargo',payload()); + +dux.addMutation(set_cargo, space => () => ({ + space, + cost: 0, + mass: space, +})); + +export default dux.asDux; diff --git a/src/dux/index.js b/src/dux/index.js index 3536b8f..0334903 100644 --- a/src/dux/index.js +++ b/src/dux/index.js @@ -10,6 +10,7 @@ import { calc_ftl_reqs } from "./ftl/rules"; import { calc_ship_req } from "./utils"; import { candidate_ship_types } from './ship_types'; import structure from './structure'; +import cargo from './cargo'; const set_ship_mass = action("set_ship_mass", payload()); const set_name = action("set_name", payload()); @@ -33,7 +34,7 @@ const initial = { }; const dux = new Updux({ - subduxes: { ftl, engine, weaponry, structure }, + subduxes: { ftl, engine, weaponry, structure, cargo }, initial }); diff --git a/webpack.config.js b/webpack.config.js index 25023c8..e73c78e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,6 +31,7 @@ module.exports = { options: { emitCss: true, hotReload: true, + dev: true, }, }, },