Reference · Rockets, variants, parts and the fit check
timeBuildfunction
Builds a ship at a level and times it: the pieces of every module and then the mesh the viewer would be handed. The budget for it is BUILD_BUDGET_MS.
Import it
import { timeBuild } from "@johnmorrisdotca/uchusen-rockets";
Definition
function timeBuild(ship: ShipList, level: "coarse" | "fine", options?: ModuleOptions): BuildTime
Parameters
| Name | Type | Description |
|---|---|---|
ship | ShipList | The ship's list. |
level | "coarse" | "fine" |
|
options (optional) | ModuleOptions | What to draw, for every module. |
Returns
BuildTime
The milliseconds, the number of pieces and of triangles.
Examples
import { SAMPLE_SHIPS, timeBuild } from "@johnmorrisdotca/uchusen-rockets";
const coarse = timeBuild(SAMPLE_SHIPS.scout, "coarse");
console.log(coarse.ms < 1000, coarse.pieces, coarse.triangles);true 43 17360What it prints (run when this page was built)