KitModule型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One module of the kit: its name, mass and size in metres, the collars at its ends, the ports on its side, and how to draw it. The origin is the middle of its base on the spine, Y up the spine, and the
module stands from y = 0 to y = length.
インポート
import type { KitModule } from "@johnmorrisdotca/uchusen-rockets";
定義
interface KitModule {
id: string;
name: string;
kind: ModuleKind;
note: string;
mass: number;
propellant: number;
length: number;
width: number;
depth: number;
top?: CollarClass;
bottom?: CollarClass;
ports: readonly Port[];
ancestor: string;
inside: boolean;
slot?: string;
livery: LiveryName;
pieces: (options?: ModuleOptions) => Piece[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | |
name | string | |
kind | ModuleKind | |
note | string | What it is, in a line a catalogue could print. |
mass | number | Dry mass in tonnes. |
propellant | number | Propellant it holds when full, in tonnes; 0 for a module with none. |
length | number | Metres along the spine (Y). |
width | number | Metres across its widest reach in X and in Z. |
depth | number | |
top (省略可) | CollarClass | undefined | The collar on its top (the end the spine continues to) and on its bottom. A module with neither is not on a spine: it hangs from a port. |
bottom (省略可) | CollarClass | undefined | |
ports | readonly Port[] | Ports on its side. |
ancestor | string | The real hardware it descends from, in a line a reader can look up. |
inside | boolean | Whether it has an inside to show. |
slot (省略可) | string | undefined | A slot name shared by modules that swap for one another: the same collars, the same size. |
livery | "foil" | "industrial" | "science" | "command" | "transport" | |
pieces | (options?: ModuleOptions) => Piece[] | The pieces, in metres. |
例
import { KIT } from "@johnmorrisdotca/uchusen-rockets";
const tank = KIT["tank-cryo-12"];
console.log(tank.name, tank.mass, tank.length, tank.width);Cryogenic fuel tank, 12 m 160 12 13.4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。