リファレンス
ジェムスワップ
import { … } from "@johnmorrisdotca/houseki/gem-swap";
最小化と gzip 圧縮をしたサイズは 21.0 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
Action | 型 | A native player action accepted or rejected according to the current phase and rules. |
advanceTicks | 関数 | Advances deterministic resolution ticks; wall-clock time is supplied separately by the host. |
advanceTime | 関数 | Adds explicit host-measured elapsed time. |
applyAction | 関数 | Applies one recorded player action. |
BlackHolePortal | 型 | A Gem Swap portal’s cell, remaining capacity, move lifetime and consumed stable ids. |
BoardPreset | 型 | A named native board geometry; custom dimensions remain a separate option. |
BoardShape | 型 | A native shaped active-cell layout applied to the row-major board. |
CAMPAIGN_CHECKSUM | 定数 | The stored Gem Swap campaign content fingerprint. |
CAMPAIGN_COUNT | 定数 | The number of stored Gem Swap campaign challenges. |
CancelToolAction | 型 | Clears the current Gem Swap tool preview. |
ChallengeRules | 型 | Gem Swap authored goals, optional move budget and seal layout. |
ConfirmToolAction | 型 | Commits the currently selected Gem Swap tool and target. |
createGame | 関数 | Creates a deterministic stable board with at least one legal normal swap. |
CreateOptions | 型 | Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together. |
decodeGame | 関数 | Validates and reconstructs a state by replay; serialized board snapshots are never trusted. |
encodeGame | 関数 | Encodes the initial rules plus accepted actions and logical inputs in canonical JSON. |
GameEvent | 型 | An event emitted by one native transition; type selects the event’s additional fields. |
GameMode | 型 | The native free, timed, daily or authored-challenge game mode. |
GameOutcome | 型 | The terminal outcome; null means the run has no terminal outcome yet. |
GamePhase | 型 | The native ready, resolution and ending phases. |
GameState | 型 | The immutable authoritative native game state, including its board, random state and recording. |
GameStatus | 型 | A compact native status derived from the authoritative state for a host’s labels. |
Gem | 型 | A gem has a stable identity and stored colour until it is cleared. |
GEM_SWAP_CAMPAIGN | 定数 | The frozen measured Gem Swap challenges with stable ids, setups, witnesses and review status. |
GEM_SWAP_LESSONS | 定数 | The frozen bilingual Gem Swap lessons with setup, teaching steps and witnesses. |
GemColour | 型 | A colour used by a normal gem. |
GemSwapCampaignLevel | 型 | One authored native challenge with its stable id, setup, winning witness, measurements and review status. |
GemSwapLesson | 型 | One bilingual native lesson with its authored setup, teaching steps and winning witness. |
GemSwapLessonStep | 型 | One bilingual native lesson instruction and the corresponding action or tick step. |
GemSwapOptionsError | クラス | Typed error for invalid settings or a board that cannot be generated safely. |
GemSwapReviewStatus | 型 | The existing campaign’s human-review-pending status; an engine witness is not human review. |
GENERATION_REVISION | 定数 | The stored Gem Swap campaign generation revision. |
Goal | 型 | The native authored goal; its discriminant selects the required collection or clearing condition. |
GRADING_VERSION | 定数 | The measurement/normalization revision used to grade Gem Swap challenges. |
GRADING_WEIGHTS | 定数 | The bounded Gem Swap metric weights used in the recorded grading formula. |
HintAction | 型 | Requests a native Gem Swap hint and marks assisted play. |
hintGame | 関数 | Returns a deterministic legal swap hint and permanently marks the run assisted. |
legalActions | 関数 | Lists all legal swaps that would be accepted from the current stable state. |
OrdinaryToolKind | 型 | A Gem Swap stored tool excluding the separately charged Black Hole. |
PlannedSpecial | 型 | The native Gem Swap cell and special kind planned for the end of a clear wave. |
ReplayError | クラス | A typed rejection of a malformed, unsupported or inconsistent native replay. |
ReplayOperation | 型 | One native Gem Swap action, fixed-tick advance or elapsed-time replay operation. |
ReshuffleAction | 型 | Requests a native Gem Swap recovery shuffle. |
reshuffleGame | 関数 | Shuffles existing gem records in Relaxed play, preserving their colour and special counts. |
restartGame | 関数 | Starts the exact initial ruleset and seed again, discarding all run progress. |
SAMPLE_BUDGET | 定数 | The fixed number of seeded playout samples used in the stored Gem Swap grading. |
Seal | 型 | A Gem Swap row-major seal cell and its remaining layers. |
SelectToolAction | 型 | Selects a stored Gem Swap tool without committing its target. |
Settings | 型 | Validated settings fixed at native game creation. |
SpecialKind | 型 | A Gem Swap beam, bomb or colour-burst special retained at its chosen anchor. |
statusOf | 関数 | Derive the native phase, score, legal-move count, tools and goal/timer progress for host labels. |
SwapAction | 型 | Swaps two row-major cell addresses. |
TargetToolAction | 型 | Previews a selected Gem Swap tool on one row-major cell. |
ToolInventory | 型 | The native remaining counts of stored tools. |
ToolKind | 型 | A Gem Swap stored tool or advanced Black Hole selection. |
Transition | 型 | The resulting native state, emitted events and acceptance decision; rejected actions preserve the input. |
UndoAction | 型 | Requests restoration of the prior Gem Swap move. |
undoGame | 関数 | Restores the last committed swap in Relaxed or Challenge play and marks assistance. |
validateChallengeWitness | 関数 | Checks a complete authored witness through the public deterministic rules API. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。