drawnPieces関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a drawing draws of a part: in a stack, what nests inside the part below is out of sight.
インポート
import { drawnPieces } from "@johnmorrisdotca/uchusen-rockets/build";
定義
function drawnPieces(part: { record: PartRecord; pieces: readonly Piece[]; }, together: boolean): readonly Piece[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
part | { record: PartRecord; pieces: readonly Piece[]; } | A built part: its record and its pieces. |
together | boolean | True when the part stands in a stack, false when it is shown alone. |
戻り値
readonly Piece[]
The pieces to draw. In a stack, what nests inside the part below is left out.
例
import { build, drawnPieces } from "@johnmorrisdotca/uchusen-rockets/build";
const [first] = build({ rocket: "falcon-9", variant: "block-5" }).parts;
if (first) console.log(drawnPieces(first, true).length, drawnPieces(first, false).length);131 131出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。