carries関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { carries } from "@johnmorrisdotca/uchusen-rockets";
定義
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[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
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 (省略可) | 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. |
戻り値
Carry[]
One carry per job.
例
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);4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。