Reference · Rockets, variants, parts and the fit check
KitModuletype
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 it
import type { KitModule } from "@johnmorrisdotca/uchusen-rockets";
Definition
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[];
}
Members
| Name | Type | Description |
|---|---|---|
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 (optional) | 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 (optional) | 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 (optional) | 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. |
Examples
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.4What it prints (run when this page was built)