Assembly型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A ship put together: its places, its mass and size, and the problems found.
インポート
import type { Assembly } from "@johnmorrisdotca/uchusen-rockets";
定義
interface Assembly {
placed: Placed[];
issues: ShipIssue[];
mass: number;
propellant: number;
length: number;
width: number;
depth: number;
ok: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
placed | Placed[] | |
issues | ShipIssue[] | |
mass | number | Dry mass in tonnes, propellant when full in tonnes. |
propellant | number | |
length | number | Metres: the box the placed modules fill (from their declared sizes). |
width | number | |
depth | number | |
ok | boolean |
例
import { assemble, type Assembly } from "@johnmorrisdotca/uchusen-rockets";
const ship: Assembly = assemble([{ module: "engine-fusion-3" }, { module: "tank-cryo-12" }]);
console.log(ship.ok, ship.placed.length, ship.mass);true 2 940出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。