リファレンス
自然と嵐の環境
import { … } from "@johnmorrisdotca/houseki/nature";
最小化と gzip 圧縮をしたサイズは 7.0 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
applyEarthquake | 関数 | Commit one bounded environmental resolution; matching, gravity and score remain the host game's job. |
applyLightning | 関数 | Commit one lightning strike. |
applyMagneticPulse | 関数 | Apply one attraction pulse. |
applyPowerDrop | 関数 | Commit a previewed landing as one immutable operation. |
AttractionPairPreview | 型 | A pure attraction decision including the paired ids, axis, gap, midpoint and moves. |
createNatureState | 関数 | Create a validated seeded native environment grid with fixed masks and mechanic switches. |
EarthquakeKind | 型 | The native fault, jumble or combined earthquake mode. |
EarthquakeOptions | 型 | The earthquake mode and optional enabled flag. |
EnvironmentEvent | 型 | A committed earthquake or lightning event with its native preview fields. |
EnvironmentPreview | 型 | A native earthquake or lightning preview before it is committed. |
EnvironmentSchedule | 型 | A periodic, one-turn or authored list of environment trigger turns. |
EnvironmentTransition | 型 | The committed environment state, event list and pure preview. |
FaultPreview | 型 | A pure earthquake fault path, removed ids and resulting occupants/passability mask. |
HorizontalDirection | 型 | The native left or right direction used for rebound decisions. |
isEnvironmentTurnScheduled | 関数 | Pure one-based schedule lookup: frequent is every second turn; rare is every eighth turn. |
JumblePreview | 型 | A pure eligible-patch shuffle and resulting occupants; reason explains when no patch exists. |
LightningOptions | 型 | Lightning enablement and explicit columns or a bounded column count. |
LightningPreview | 型 | A pure selected-column removal and resulting occupants/random state. |
MagneticPreview | 型 | A pure magnetic-pulse result; no input state or random source is consumed. |
MarkingOptions | 型 | The probability and optional count/anchor bounds used to mark magnetic stones. |
markMagneticStones | 関数 | Deterministically assign magnetic markings to settled stones without changing their IDs or colours. |
NatureEntity | 型 | Stable board occupant. |
NatureErrorCode | 型 | Stable native validation codes for grid, cell, marking and power-drop failures. |
NatureEvent | 型 | An emitted native magnetic marking, attraction or power-drop event. |
NatureMove | 型 | One native stable-id move between two board coordinates. |
NatureOptions | 型 | The native grid dimensions, passability mask, occupants, seed and magnetic/rebound settings. |
NatureOptionsError | クラス | A typed native grid, cell, marking or power-drop validation error. |
NaturePieceCell | 型 | A falling native stone with its cell coordinates and stable id. |
NatureRules | 型 | The fixed native magnetic and rebound rule switches. |
NatureState | 型 | The immutable native environment state with stable ids, seeded random state and placement count. |
NatureTransition | 型 | The native environment result, emitted events and optional pure preview. |
PowerDropPreview | 型 | The pure normal landing, rebound attempts and final lock cells with resulting random state. |
PowerDropRequest | 型 | The native piece cells, pivot id and host-selected power/rebound options. |
previewEarthquake | 関数 | Preview an earthquake, with Combined always fracturing before its one jumble attempt. |
previewFault | 関数 | Preview a bounded top-to-bottom fracture. |
previewJumble | 関数 | Preview one seeded, nontrivial stone permutation inside a fully active connected rectangle no larger than 3×3. |
previewLightning | 関数 | Preview seeded or explicitly selected columns; a mask gap or obstacle blocks the strike below it. |
previewMagneticPulse | 関数 | Preview one bounded deterministic attraction pulse without mutating the state. |
previewPowerDrop | 関数 | Preview a single normal landing and, for a power drop, at most one validated one-cell rebound. |
QuarterTurn | 型 | A counterclockwise, unchanged or clockwise quarter-turn chosen by the host. |
ReboundAttemptPreview | 型 | One tested rebound direction and quarter-turn with its collision-validity result. |
ReboundDirectionMode | 型 | Whether rebound prefers recent input/alternation or the seeded random source. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。