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