add weaponry to the shipEdit component
This commit is contained in:
parent
1cac278c7c
commit
231b3547d5
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
<Structure {...$shipState.structure} />
|
<Structure {...$shipState.structure} />
|
||||||
|
|
||||||
|
<Weaponry {...$shipState.weaponry}/>
|
||||||
|
|
||||||
<Carrier {...$shipState.carrier} />
|
<Carrier {...$shipState.carrier} />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -18,6 +20,7 @@
|
|||||||
import Propulsion from "./Propulsion/index.svelte";
|
import Propulsion from "./Propulsion/index.svelte";
|
||||||
import Structure from "./Structure/index.svelte";
|
import Structure from "./Structure/index.svelte";
|
||||||
import Carrier from "./Carrier/index.svelte";
|
import Carrier from "./Carrier/index.svelte";
|
||||||
|
import Weaponry from "./Weaponry/index.svelte";
|
||||||
|
|
||||||
const { state: shipState } = getContext("ship");
|
const { state: shipState } = getContext("ship");
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,31 +1,33 @@
|
|||||||
import { Updux } from "updux";
|
import { Updux } from "updux";
|
||||||
import u from 'updeep';
|
import u from "updeep";
|
||||||
|
|
||||||
import propulsion from "./propulsion/index.js";
|
import propulsion from "./propulsion/index.js";
|
||||||
import identification from "./identification.js";
|
import identification from "./identification.js";
|
||||||
import { calculateDriveReqs } from './propulsion/drive.js';
|
import { calculateDriveReqs } from "./propulsion/drive.js";
|
||||||
import { ftlReqsReaction } from './propulsion/ftl.js';
|
import { ftlReqsReaction } from "./propulsion/ftl.js";
|
||||||
import structure from './structure/index.js';
|
import structure from "./structure/index.js";
|
||||||
import carrier from './carrier.js';
|
import carrier from "./carrier.js";
|
||||||
import { screensReqsReaction } from './structure/screens.js'
|
import weaponry from "./weaponry/index.js";
|
||||||
|
import { screensReqsReaction } from "./structure/screens.js";
|
||||||
|
|
||||||
const dux = new Updux({
|
const dux = new Updux({
|
||||||
subduxes: {
|
subduxes: {
|
||||||
identification,
|
identification,
|
||||||
propulsion,
|
propulsion,
|
||||||
structure, carrier
|
structure,
|
||||||
},
|
carrier,
|
||||||
initial: {
|
weaponry,
|
||||||
reqs: { cost: 0, mass: 10, usedMass: 0 },
|
},
|
||||||
},
|
initial: {
|
||||||
actions: {
|
reqs: { cost: 0, mass: 10, usedMass: 0 },
|
||||||
}
|
},
|
||||||
|
actions: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
dux.setMutation( 'setShipMass', mass => u({reqs: {mass}}) );
|
dux.setMutation("setShipMass", (mass) => u({ reqs: { mass } }));
|
||||||
|
|
||||||
dux.addReaction( calculateDriveReqs );
|
dux.addReaction(calculateDriveReqs);
|
||||||
dux.addReaction( ftlReqsReaction );
|
dux.addReaction(ftlReqsReaction);
|
||||||
dux.addReaction( screensReqsReaction );
|
dux.addReaction(screensReqsReaction);
|
||||||
|
|
||||||
export default dux;
|
export default dux;
|
||||||
|
Loading…
Reference in New Issue
Block a user