timeBuild関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { timeBuild } from "@johnmorrisdotca/uchusen-rockets";
定義
function timeBuild(ship: ShipList, level: "coarse" | "fine", options?: ModuleOptions): BuildTime
引数
| 名前 | 型 | 説明 |
|---|---|---|
ship | ShipList | The ship's list. |
level | "coarse" | "fine" |
|
options (省略可) | ModuleOptions | What to draw, for every module. |
戻り値
BuildTime
The milliseconds, the number of pieces and of triangles.
例
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 17360出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。