Reference
Colour Chains
import { … } from "@johnmorrisdotca/houseki/colour-chains";
75.9 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. |
actionsForTick | function | Resolves this tick's inputs in lateral, rotation, drop, soft-drop, pause order. |
advanceTicks | function | Advances deterministic 60 Hz simulation and resolution; Relaxed and Challenges do not force a falling clock. |
applyAction | function | Applies one immutable accepted action and records its logical-tick position. |
applyScheduledActions | function | Applies a scheduler batch until the pair locks or the run pauses; accepted actions are recorded by the engine. |
arashiCampaignManifest | constant | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
arashiLevelManifest | constant | The frozen ordered native levels; array indices start at zero and display numbers start at one. |
campaignManifest | constant | The frozen native campaign manifest with its ordering, revisions, checksum and measured levels. |
Cell | type | A visible or hidden board coordinate. |
ChainCampaignLevel | type | One authored native challenge with its stable id, setup, winning witness, measurements and review status. |
ChainCampaignManifest | type | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
ChainContentData | type | The stored native Colour Chains campaign, lessons and optional Shizen/Arashi campaigns. |
ChainDifficultyMetrics | type | The bounded engine measurements used to grade this campaign; they do not claim human difficulty. |
ChainsPowerDropPreview | type | The Shizen hard-drop preview: the one-step rebound and where the pair locks (finalCells), and where each stone of the pair comes to rest once the committed drop's gravity has run (settledCells). |
ChainTutorialDefinition | type | One bilingual native lesson with its authored setup, teaching steps and winning witness. |
ChainTutorialStep | type | One bilingual native lesson instruction and the corresponding action or tick step. |
ChallengeGem | type | Authored challenge layouts can include explicit Shizen-marked stones. |
ChallengeGoal | type | Challenge objective; target IDs refer to the visible starting board. |
ChallengeOptions | type | Authored challenge inputs including the starting board, finite goal and supplied witness. |
Colour | type | A gem colour used by Colour Chains. |
createArashiLevel | function | Create a validated native Arashi challenge using its stored setup and winning witness. |
createChallenge | function | Validates and creates a finite witnessed challenge. |
createGame | function | Creates a deterministic seeded game with one active pair and three previews. |
createInputScheduler | function | Creates an empty held-input scheduler. |
createLevel | function | Create a fresh engine-validated challenge from a stable content ID or display number. |
CreateOptions | type | Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together. |
createShizenLevel | function | Create a validated native Shizen challenge using its stored setup and winning witness. |
decodeGame | function | Reconstructs a bounded action replay and rejects any checkpoint that differs from replay. |
encodeGame | function | Encodes canonical initial settings, accepted ordinal actions and a derived checkpoint. |
GameEvent | type | A domain event emitted by one transition. |
GameState | type | An immutable Colour Chains rules state. |
GameStatus | type | Compact player status derived from the current state. |
Gem | type | A settled or active stone with a stable run-local identity. |
getArashiLevel | function | Find a native Arashi challenge by stable id or one-based display number. |
getLevel | function | Find a campaign challenge by stable content ID or its current one-based number. |
getShizenLevel | function | Find a native Shizen challenge by stable id or one-based display number. |
getTutorial | function | Find a persistent interactive lesson by its stable ID. |
HeldControl | type | A lateral or soft-drop control which the input scheduler can repeat. |
InputCommand | type | A native held-control change or one-shot edge command for Colour Chains. |
Landing | type | Destination cells for the two independently settled ghost stones. |
landingCells | function | Returns the exact independent landing cells for the current rigid pair without consuming random values. |
legalActions | function | Lists only actions accepted by the current game state. |
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. |
Mode | type | The native game mode; authored challenges have fixed setup and queue rules. |
NatureCampaignBand | type | An inclusive one-based range in a measured native nature-campaign difficulty band. |
NatureChainCampaignLevel | type | One authored native challenge with its stable id, setup, winning witness, measurements and review status. |
NatureChainCampaignManifest | type | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
Orientation | type | The pivot-to-satellite direction, in clockwise order. |
Pair | type | The active rigid pair. |
Phase | type | Observable game phases. |
PlayAction | type | One native Colour Chains player command, including pause and hint commands. |
powerDropPreview | function | Returns the Shizen hard-drop landing and one-step rebound preview without changing state. |
Preset | type | Supported well presets. |
processInputTick | function | Applies a complete deterministic held-input and simulation tick, releasing controls on lock or resolution. |
queueInputEdge | function | Queues a one-shot rotation, drop, Place, pause or resume edge for the next logical tick. |
RecordedAction | type | A native action recording with the logical position needed for deterministic replay. |
releaseAllInput | function | Releases every held or queued control after focus loss, lock, resolution or pause. |
restartGame | function | Restarts the same seed/date or original witnessed challenge board and queue. |
setHeldInput | function | Starts or releases one held control. |
Settings | type | Run settings fixed at game creation. |
shizenCampaignManifest | constant | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
shizenLevelManifest | constant | The frozen ordered native levels; array indices start at zero and display numbers start at one. |
statusOf | function | Returns score, mode, chain and completion fields derived from state. |
StoneChainsOptionsError | class | Typed setup and authored challenge error. |
Transition | type | A deterministic transition; rejected actions retain the exact input state. |
tutorialManifest | constant | The frozen native bilingual lessons and their authored teaching steps. |
Wave | type | A scored simultaneous match wave. |
WeatherSchedule | type | The native frequent or rare weather schedule for Colour Chains. |
WitnessStep | type | One witnessed Colour Chains pair placement using pivot column and orientation. |