Reference
Stone Collapse
import { … } from "@johnmorrisdotca/houseki/stone-collapse";
32.5 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
Action | type | A native player action accepted or rejected according to the current phase and rules. |
advanceTicks | function | Advances the observable 7/6/9 tick removal and gravity stages, bounded to 3600 ticks. |
applyAction | function | Applies a selection, confirmation, or cancellation without mutating its input. |
BoardPreset | type | A named native board geometry; custom dimensions remain a separate option. |
BoardShape | type | A native shaped active-cell layout applied to the row-major board. |
campaignManifest | constant | The frozen native campaign manifest with its ordering, revisions, checksum and measured levels. |
ChallengeDefinition | type | A validated Stone Collapse authored setup and stable-id group witness. |
ChallengeGoal | type | A native authored challenge objective; its discriminant selects target, chain, empty-board or score requirements. |
ChallengeOptions | type | Authored challenge inputs including the starting board, finite goal and supplied witness. |
CollapseCampaignLevel | type | One authored native challenge with its stable id, setup, winning witness, measurements and review status. |
CollapseCampaignManifest | type | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
CollapseDifficultyMetrics | type | The bounded engine measurements used to grade this campaign; they do not claim human difficulty. |
CollapseTutorialDefinition | type | One bilingual native lesson with its authored setup, teaching steps and winning witness. |
CollapseTutorialStep | type | One bilingual native lesson instruction and the corresponding action or tick step. |
createChallenge | function | Creates a fixed witnessed challenge after validating its board, objective, move budget, and every witness group. |
createGame | function | Creates a seeded full board; an all-singleton draw retries before using a checked adjacent pair. |
createLevel | function | Construct a fresh engine-validated challenge from a content ID or display number. |
CreateOptions | type | Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together. |
decodeGame | function | Reconstructs and validates a bounded replay before accepting its checkpoint. |
encodeGame | function | Encodes the canonical initial configuration, accepted replay actions, and a derived checkpoint. |
GameEvent | type | An event emitted by one native transition; type selects the event’s additional fields. |
GameMode | type | The native free, timed, daily or authored-challenge game mode. |
GamePhase | type | The native ready, resolution and ending phases. |
GameState | type | The immutable authoritative native game state, including its board, random state and recording. |
GameStatus | type | A compact native status derived from the authoritative state for a host’s labels. |
getLevel | function | Find a challenge by its persistent content ID or current one-based display number. |
getTutorial | function | Find a persistent interactive lesson by its stable ID. |
legalActions | function | Lists every selection and confirmation currently accepted by the rules. |
levelManifest | constant | The frozen ordered native levels; array indices start at zero and display numbers start at one. |
LocalizedText | type | One authored text in English and Japanese. |
RecordedAction | type | A native action recording with the logical position needed for deterministic replay. |
requestHint | function | Selects the next supplied witness group only while the run still matches its path; accepted hints mark the run assisted. |
restartGame | function | Starts a fresh attempt from the identical seeded board or preserved challenge definition. |
Settings | type | Validated settings fixed at native game creation. |
statusOf | function | Returns the stable public game status and the remaining-stone count. |
Stone | type | A stone keeps its run-local identity as it falls or changes column. |
StoneCollapseOptionsError | class | Typed public-settings validation error. |
StoneColour | type | A colour used by a stone. |
StoredTool | type | A stored Stone Collapse tool selected from the native Bomb and Pick tray. |
ToolInventory | type | The native remaining counts of stored tools. |
Transition | type | The resulting native state, emitted events and acceptance decision; rejected actions preserve the input. |
tutorialManifest | constant | The frozen native bilingual lessons and their authored teaching steps. |
undo | function | Restores the full pre-move state in Relaxed or Challenge practice and permanently marks the attempt assisted. |
UndoFrame | type | Data sufficient to restore the complete game immediately before a committed move. |