リファレンス
積み木
import { … } from "@johnmorrisdotca/houseki/tsumiki";
最小化と gzip 圧縮をしたサイズは 10.0 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
Action | 型 | One move: a piece from the tray, placed with its top left on a cell. |
ActionResult | 型 | What an applied action came to: whether it was taken, the state after it, and what happened. |
advanceTicks | 関数 | Advances nothing: a placement is whole the moment it is made. |
applyAction | 関数 | Plays one move: a piece is laid, every full row and column clears together, and the tray fills when it is empty. |
Block | 型 | One filled cell: its run-local identity, its colour, and whether it is a stone a challenge asks to be cleared. |
BlockColour | 型 | A colour used by a placed block. |
BOARD_SIDE | 定数 | The board's side: eight cells each way. |
canPlace | 関数 | Whether a piece from the tray can go with its top left on this cell, for a host to draw a ghost. |
ChallengeGoal | 型 | What a challenge asks for: a score, a number of lines, or every stone cleared. |
ChallengeOptions | 型 | An authored game: its identity, seed, goal and the stones it starts with. |
createChallenge | 関数 | Makes an authored game from its seed, goal and stones. |
createGame | 関数 | Makes a free game or a Daily: a Daily's seed is its date, so one date is one game for everybody. |
createLevel | 関数 | Makes a level's game; throws for a level that does not exist. |
CreateOptions | 型 | The options a free game or a Daily is made from. |
createTutorial | 関数 | Makes a lesson's game; throws for a lesson that does not exist. |
decodeGame | 関数 | Reads a save by playing it again from the start, so a save cannot claim what its moves do not do. |
encodeGame | 関数 | A game as text: what it was and the moves made, never the score or the board, which a replay works out. |
GameEvent | 型 | What a move made happen, for a host to draw or sound. |
GameMode | 型 | The free, daily or authored game mode. |
GamePhase | 型 | Where a game stands: waiting for a placement, won, lost, or finished with a score. |
GameSettings | 型 | How a game was set up, the whole of what a replay needs but the moves. |
GameState | 型 | The whole of a game, returned new by every move: nothing in it is changed in place. |
GameStatus | 型 | A game's figures as a host would show them. |
getLevel | 関数 | Looks a level up by its id or its display number; null where there is none. |
getTutorial | 関数 | Looks a lesson up by its id; null where there is none. |
legalActions | 関数 | Every placement allowed now, a bot's or a test's whole view of what can be done. |
levelManifest | 定数 | The frozen graded levels, in order; array indices start at zero and display numbers at one. |
LocalizedText | 型 | Words in both languages. |
Piece | 型 | A shape in the tray: its name, its colour, and its cells as row and column from its own top left. |
restartGame | 関数 | The same game from its start, with the same settings. |
statusOf | 関数 | A game's figures: its phase, its score, its lines and how far along its goal it is. |
TsumikiLevel | 型 | One graded level: its seed, goal and stones, and a line of moves the engine has been shown to win with. |
TsumikiTutorial | 型 | One bilingual lesson, with the game it is played on and a line of moves that wins it. |
TsumikiTutorialStep | 型 | One step of a lesson. |
tutorialManifest | 定数 | The frozen bilingual lessons. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。