Reference · Rockets, variants, parts and the fit check
carriesfunction
Where each drone is at at. Most of the crew is at the part, spread all the way round it. A few fly out for a shop-sized piece, and a few charge at a berth. The part itself stays where it is built.
Import it
import { carries } from "@johnmorrisdotca/uchusen-rockets";
Definition
function carries(jobs: readonly SwarmJob[], at: number, steps: readonly PlayStep[], slotAt: (slot: string) => readonly [number, number, number] | undefined, dock: readonly [number, number, number], length?: readonly [number, number]): Carry[]
Parameters
| Name | Type | Description |
|---|---|---|
jobs | readonly SwarmJob[] | Which slot each drone is on. |
at | number | How far through the build, from 0 to 1. |
steps | readonly PlayStep[] | The ship's build order. |
slotAt | (slot: string) => readonly [number, number, number] | undefined | Where a finished slot stands. |
dock | readonly [number, number, number] | The parts stack, beside the ship. |
length (optional) | readonly [number, number] | undefined | The ship's length, stern then bow, so drones in transit spread along it. Omitted, they spread from the stack to the slot. |
Returns
Carry[]
One carry per job.
Examples
import { buildOf, carries, swarmJobs } from "@johnmorrisdotca/uchusen-rockets";
const steps = buildOf("miyamoto") ?? [];
const jobs = swarmJobs(steps, 4, 0);
console.log(carries(jobs, 0, steps, () => [0, 0, 0], [40, 0, 0]).length);4What it prints (run when this page was built)