@pompidup/kingdomino-engine 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -17
- package/dist/index.d.ts +81 -4
- package/dist/index.js +346 -145
- package/dist/index.js.map +1 -1
- package/dist/index.universal.js +346 -145
- package/dist/wasm-bridge.js +325 -135
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,15 +42,19 @@ while (isGameWithNextAction(game)) {
|
|
|
42
42
|
const { nextLord, nextAction } = game.nextAction;
|
|
43
43
|
|
|
44
44
|
if (nextAction === "pickDomino") {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
game = engine.chooseDomino({ game, lordId: nextLord, dominoPick: domino.domino.number });
|
|
48
|
-
}
|
|
45
|
+
const [dominoPick] = engine.getValidDominoPicks({ game });
|
|
46
|
+
game = engine.chooseDomino({ game, lordId: nextLord, dominoPick });
|
|
49
47
|
} else if (nextAction === "placeDomino") {
|
|
50
48
|
const lord = game.lords.find((l) => l.id === nextLord);
|
|
51
49
|
const player = game.players.find((p) => p.id === lord?.playerId);
|
|
52
50
|
if (lord?.dominoPicked && player) {
|
|
53
|
-
|
|
51
|
+
// maxKingdomSize: 5, or 7 for a 7x7 kingdom (The Mighty Duel, Neolithic,
|
|
52
|
+
// QueenDomino and AgeOfGiants-QueenDomino at 2 players)
|
|
53
|
+
const placements = engine.getValidPlacements({
|
|
54
|
+
kingdom: player.kingdom,
|
|
55
|
+
domino: lord.dominoPicked,
|
|
56
|
+
maxKingdomSize: game.rules.basic.maxKingdomSize,
|
|
57
|
+
});
|
|
54
58
|
if (placements.length > 0) {
|
|
55
59
|
game = engine.placeDomino({ game, lordId: nextLord, position: placements[0].position, rotation: placements[0].rotation });
|
|
56
60
|
} else {
|
|
@@ -71,12 +75,12 @@ console.log(results.result);
|
|
|
71
75
|
| Mode | Description |
|
|
72
76
|
|------|-------------|
|
|
73
77
|
| **Classic** | Original Kingdomino rules. 1-4 players, 5x5 kingdom, terrain-based scoring. |
|
|
74
|
-
| **QueenDomino** | Full Queendomino expansion with buildings, coins, knights, the Queen and the Dragon. |
|
|
78
|
+
| **QueenDomino** | Full Queendomino expansion with buildings, coins, knights, the Queen and the Dragon. 2-4 players (7x7 kingdom with the 48 dominoes at 2 players). |
|
|
75
79
|
| **KingdominoOrigins-Discovery** | Origins expansion — volcanoes, fire tokens, fire-based scoring. |
|
|
76
80
|
| **KingdominoOrigins-Totem** | Origins — Discovery + wooden resources + totem majority tiles. |
|
|
77
81
|
| **KingdominoOrigins-Tribe** | Origins — Discovery + resources + cave board + cavemen recruitment. |
|
|
78
82
|
| **AgeOfGiants** | Age of Giants extension — giants, quest tiles, 5-player support, 12 new dominos on Classic. |
|
|
79
|
-
| **AgeOfGiants-QueenDomino** | Age of Giants combined with QueenDomino. |
|
|
83
|
+
| **AgeOfGiants-QueenDomino** | Age of Giants combined with QueenDomino (7x7 kingdom with the 60 dominoes at 2 players). |
|
|
80
84
|
|
|
81
85
|
```typescript
|
|
82
86
|
let game = engine.createGame({ mode: "Classic" });
|
|
@@ -92,11 +96,12 @@ See [Game Modes](docs/game-modes.md) for rules, player counts, and extra rules d
|
|
|
92
96
|
The QueenDomino mode adds significant new mechanics to the base game:
|
|
93
97
|
|
|
94
98
|
- **Construction squares** on some domino tiles where buildings can be placed
|
|
95
|
-
- **Coins** (7 starting) used to purchase buildings or
|
|
96
|
-
- **Knights** (
|
|
97
|
-
- **Buildings**
|
|
98
|
-
- **The Queen**
|
|
99
|
-
- **The Dragon** burns a building tile from the Builders Board
|
|
99
|
+
- **Coins** (7 starting) used to purchase buildings or bribe the Dragon; 1 point per 3 unused coins at the end of the game
|
|
100
|
+
- **Knights** (1 at the start, more from building bonuses) placed on the domino just placed, up to 2 per turn, collecting 1 coin per square of the territory
|
|
101
|
+
- **Buildings** purchased from the 6-spot Builders Board (spots costing 5 to 0 coins), granting crowns, towers, and end-game bonuses
|
|
102
|
+
- **The Queen** hosted by the player who reaches the most towers (even on a tie): -1 coin on her host's constructions, +1 crown on their largest territory at the end
|
|
103
|
+
- **The Dragon** burns a building tile from the Builders Board for 1 coin
|
|
104
|
+
- **2 players**: 7x7 kingdoms with all 48 dominoes (official rule)
|
|
100
105
|
|
|
101
106
|
The turn flow is extended with optional actions after placing a domino:
|
|
102
107
|
|
|
@@ -147,10 +152,13 @@ if (nextAction === "placeGiant") {
|
|
|
147
152
|
game = engine.placeGiant({ game, lordId: nextLord, position });
|
|
148
153
|
}
|
|
149
154
|
if (nextAction === "sendGiant") {
|
|
150
|
-
|
|
155
|
+
// The targeted opponent chooses the crown the giant covers
|
|
156
|
+
game = engine.sendGiant({ game, lordId: nextLord, giantIndex, targetPlayerId });
|
|
151
157
|
}
|
|
152
158
|
```
|
|
153
159
|
|
|
160
|
+
After `sendGiant`, a single free crown of the opponent is covered automatically. With several free crowns, `game.ageOfGiants.pendingGiant` is set and the game waits for a `placeGiant` played by a lord of the **targeted** player (`getValidGiantPositions` lists its crowns). `targetCrownPosition` is still accepted for backward compatibility.
|
|
161
|
+
|
|
154
162
|
See [Age of Giants Guide](docs/age-of-giants.md) for the complete rules and mechanics.
|
|
155
163
|
|
|
156
164
|
## Extra Rules
|
|
@@ -159,13 +167,16 @@ See [Age of Giants Guide](docs/age-of-giants.md) for the complete rules and mech
|
|
|
159
167
|
|------|-------------|-------------|
|
|
160
168
|
| **The Middle Kingdom** | +10 points if castle is centered | — |
|
|
161
169
|
| **Harmony** | +5 points if no dominos were discarded | — |
|
|
162
|
-
| **The Mighty Duel** | All 48 dominos, 7x7 kingdom | 2 players only |
|
|
170
|
+
| **The Mighty Duel** | All 48 dominos, 7x7 kingdom | 2 players only (QueenDomino already plays 7x7 at 2 players: accepted, without further effect) |
|
|
163
171
|
| **Dynasty** | Play 3 games, highest total wins | — |
|
|
164
172
|
|
|
173
|
+
Origins has its own equivalents: **Empire of Fire**, **Homo Habilis**, **Neolithic** (2 players, 7x7, and the first pick of each line takes the dominoes 1 & 4 or 2 & 3 — see [Origins Guide](docs/origins.md#neolithic-2-players)) and **Dynasty**.
|
|
174
|
+
|
|
165
175
|
```typescript
|
|
166
176
|
game = engine.addExtraRules({ game, extraRules: ["The middle Kingdom", "Harmony"] });
|
|
167
177
|
|
|
168
|
-
// Dynasty: aggregate results from multiple games
|
|
178
|
+
// Dynasty: aggregate results from multiple games (grouped by player id: pass
|
|
179
|
+
// the same stable ids to addPlayers in every game, e.g. { id: "alice", name: "Alice" })
|
|
169
180
|
const dynastyResults = engine.getDynastyResults({ games: [game1, game2, game3] });
|
|
170
181
|
```
|
|
171
182
|
|
|
@@ -202,6 +213,8 @@ const engine = createGameEngine({
|
|
|
202
213
|
| `calculateScore` | Calculate score for any kingdom |
|
|
203
214
|
| `getValidPlacements` | Find all valid placements for a domino |
|
|
204
215
|
| `canPlaceDomino` | Check if any placement exists |
|
|
216
|
+
| `getValidDominoPicks` | Dominoes the lord to play may pick (Neolithic reservations included) |
|
|
217
|
+
| `calculatePlayerScore` | Mode-aware live (or final) score of one player, with its breakdown |
|
|
205
218
|
| `serialize` / `deserialize` | Save and restore game state |
|
|
206
219
|
| `getDynastyResults` | Aggregate scores from multiple games |
|
|
207
220
|
|
|
@@ -211,7 +224,7 @@ const engine = createGameEngine({
|
|
|
211
224
|
|--------|-------------|
|
|
212
225
|
| `placeKnight` | Place a knight and collect tax |
|
|
213
226
|
| `constructBuilding` | Buy and place a building |
|
|
214
|
-
| `useDragon` | Destroy a building tile from the board |
|
|
227
|
+
| `useDragon` | Destroy a building tile from the board (1 coin) |
|
|
215
228
|
| `skipOptionalAction` | Skip the current optional action |
|
|
216
229
|
|
|
217
230
|
### Origins Methods
|
|
@@ -228,6 +241,10 @@ const engine = createGameEngine({
|
|
|
228
241
|
| `placeGiant` | Place a giant on a crown in your kingdom |
|
|
229
242
|
| `sendGiant` | Send a giant to an opponent's kingdom |
|
|
230
243
|
|
|
244
|
+
### Valid targets
|
|
245
|
+
|
|
246
|
+
`getValidFireTokenPositions`, `getValidKnightPositions`, `getValidBuildingPositions`, `getAffordableBuildings`, `getValidDragonTargets`, `getValidCavemanPlacements`, `getValidGiantPositions`, `getValidGiantTargets` and `canSkipOptionalAction` list what the extension actions accept, with the same checks as the actions (see [Valid targets](docs/api-reference.md#valid-targets-for-extension-actions)).
|
|
247
|
+
|
|
231
248
|
See [API Reference](docs/api-reference.md) for complete method signatures, types, and error codes.
|
|
232
249
|
|
|
233
250
|
## Additional Features
|
|
@@ -235,7 +252,7 @@ See [API Reference](docs/api-reference.md) for complete method signatures, types
|
|
|
235
252
|
- **Bot / AI**: 4 built-in strategies (`randomStrategy`, `greedyStrategy`, `advancedStrategy`, `expertStrategy`) with `playBotTurn()` helper; mode-aware (they evaluate with the mode-aware score and play the Queendomino, Origins and Age of Giants actions — see [Bot Strategies](docs/api-reference.md#bot-strategies))
|
|
236
253
|
- **Mixed games**: Human and bot players in the same game via `bot: { strategyName }` on player input
|
|
237
254
|
- **Undo / Redo**: Snapshot-based history with `createGameHistory()`, `pushState()`, `undo()`, `redo()`
|
|
238
|
-
- **Action Log**: Immutable log via `wrapWithActionLog(engine)` for replay with `replayActions()
|
|
255
|
+
- **Action Log**: Immutable log via `wrapWithActionLog(engine)` for replay with `replayActions()`; format v2 records the seed and the game, player and lord ids, so a replay gives a strictly identical state (v1 logs remain replayable)
|
|
239
256
|
- **Events**: Callbacks via `EngineConfig.events` (`onDominoPlaced`, `onGameEnd`, etc.)
|
|
240
257
|
- **Debug Mode**: `wrapWithDebug(engine)` with 3 verbosity levels
|
|
241
258
|
- **Seeded games**: Deterministic shuffle via `createGame({ mode, seed: "my-seed" })`
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,13 @@ type RevealsDomino = {
|
|
|
73
73
|
lordId: string | null;
|
|
74
74
|
/** Display position in the revealed set (for UI ordering) */
|
|
75
75
|
position: number;
|
|
76
|
+
/**
|
|
77
|
+
* Id of the player this domino is reserved for (Kingdomino Origins
|
|
78
|
+
* "Neolithic" rule): set on the whole line by its first pick, the pair
|
|
79
|
+
* 1 & 4 or 2 & 3 going to that lord's player and the two other dominoes to
|
|
80
|
+
* the opponent. Only lords of this player can pick it. Absent otherwise.
|
|
81
|
+
*/
|
|
82
|
+
reservedFor?: string;
|
|
76
83
|
};
|
|
77
84
|
|
|
78
85
|
/**
|
|
@@ -424,7 +431,12 @@ type BuildingTile = {
|
|
|
424
431
|
id: number;
|
|
425
432
|
/** Display name */
|
|
426
433
|
name: string;
|
|
427
|
-
/**
|
|
434
|
+
/**
|
|
435
|
+
* Intrinsic cost of the tile. On a Builders Board with `slotCosts` (every
|
|
436
|
+
* game started since the official 6-spot board), the price is carried by
|
|
437
|
+
* the spot the tile occupies instead (see `BuildersBoard.slotCosts`); this
|
|
438
|
+
* value is only used by boards without `slotCosts` (older saved games).
|
|
439
|
+
*/
|
|
428
440
|
cost: number;
|
|
429
441
|
/** Immediate bonus when constructed (optional) */
|
|
430
442
|
immediateBonus?: ImmediateBonus;
|
|
@@ -441,12 +453,26 @@ type BuildingTile = {
|
|
|
441
453
|
type BuildingSlot = BuildingTile | null;
|
|
442
454
|
/**
|
|
443
455
|
* The Builders Board holding available building tiles for purchase.
|
|
456
|
+
*
|
|
457
|
+
* Official board: 6 spots whose construction cost is printed below them
|
|
458
|
+
* (5, 4, 3, 2, 1 and 0 coins, from the draw pile to the cheapest spot). At
|
|
459
|
+
* each new round the remaining tiles slide to the cheapest spots and the
|
|
460
|
+
* empty spots are filled from the draw pile.
|
|
444
461
|
*/
|
|
445
462
|
type BuildersBoard = {
|
|
446
|
-
/**
|
|
463
|
+
/**
|
|
464
|
+
* Visible building tiles available for purchase, one per spot (6 spots; 4 in
|
|
465
|
+
* games started before the official board). `null` is an empty spot.
|
|
466
|
+
*/
|
|
447
467
|
slots: BuildingSlot[];
|
|
448
468
|
/** Remaining building tiles in the draw pile */
|
|
449
469
|
drawPile: BuildingTile[];
|
|
470
|
+
/**
|
|
471
|
+
* Construction cost of each spot, aligned with `slots` (`[5, 4, 3, 2, 1, 0]`).
|
|
472
|
+
* Absent in games started before the official board: the price is then the
|
|
473
|
+
* tile's own `cost`.
|
|
474
|
+
*/
|
|
475
|
+
slotCosts?: number[];
|
|
450
476
|
};
|
|
451
477
|
/**
|
|
452
478
|
* A building that has been placed on a player's kingdom.
|
|
@@ -603,6 +629,12 @@ type Rules = {
|
|
|
603
629
|
basic: Record<number, BasicRules>;
|
|
604
630
|
/** Age of Giants basic rules indexed by player count (2-5) */
|
|
605
631
|
aogBasic?: Record<number, BasicRules>;
|
|
632
|
+
/**
|
|
633
|
+
* Basic rules specific to one game mode, indexed by mode name then player
|
|
634
|
+
* count. They take precedence over `basic` / `aogBasic` for that mode and
|
|
635
|
+
* player count (e.g. Queendomino at 2 players: 7x7 kingdom, 48 dominoes).
|
|
636
|
+
*/
|
|
637
|
+
modeBasic?: Record<string, Record<number, BasicRules>>;
|
|
606
638
|
/** Available extra rules */
|
|
607
639
|
extraRules: ExtraRule[];
|
|
608
640
|
};
|
|
@@ -641,6 +673,7 @@ declare const ErrorCode: {
|
|
|
641
673
|
readonly CANNOT_PICK: "CANNOT_PICK";
|
|
642
674
|
readonly CANNOT_PLACE: "CANNOT_PLACE";
|
|
643
675
|
readonly DOMINO_ALREADY_PICKED: "DOMINO_ALREADY_PICKED";
|
|
676
|
+
readonly DOMINO_RESERVED: "DOMINO_RESERVED";
|
|
644
677
|
readonly UNDO_UNAVAILABLE: "UNDO_UNAVAILABLE";
|
|
645
678
|
readonly REDO_UNAVAILABLE: "REDO_UNAVAILABLE";
|
|
646
679
|
readonly CANNOT_PLACE_KNIGHT: "CANNOT_PLACE_KNIGHT";
|
|
@@ -755,6 +788,7 @@ declare const TranslationKey: {
|
|
|
755
788
|
readonly ERROR_CANNOT_PICK: "error.cannotPick";
|
|
756
789
|
readonly ERROR_CANNOT_PLACE: "error.cannotPlace";
|
|
757
790
|
readonly ERROR_DOMINO_ALREADY_PICKED: "error.dominoAlreadyPicked";
|
|
791
|
+
readonly ERROR_DOMINO_RESERVED: "error.dominoReserved";
|
|
758
792
|
readonly ERROR_INVALID_PLAYER_COUNT: "error.invalidPlayerCount";
|
|
759
793
|
readonly ERROR_INVALID_PLAYER_NAME: "error.invalidPlayerName";
|
|
760
794
|
readonly ERROR_EXTRA_RULE_NOT_AVAILABLE: "error.extraRuleNotAvailable";
|
|
@@ -842,6 +876,7 @@ declare const TranslationKey: {
|
|
|
842
876
|
readonly ERROR_INVALID_PLAYER_ID: "error.invalidPlayerId";
|
|
843
877
|
readonly SCORE_QUEEN: "score.queen";
|
|
844
878
|
readonly SCORE_BUILDING: "score.building";
|
|
879
|
+
readonly SCORE_WEALTH: "score.wealth";
|
|
845
880
|
readonly SCORE_TOTEM_MAMMOTH: "score.totemMammoth";
|
|
846
881
|
readonly SCORE_TOTEM_FISH: "score.totemFish";
|
|
847
882
|
readonly SCORE_TOTEM_MUSHROOM: "score.totemMushroom";
|
|
@@ -997,6 +1032,8 @@ declare const scoreBonusTypes: {
|
|
|
997
1032
|
readonly queen: "queen";
|
|
998
1033
|
/** Queendomino: end-game scoring of one constructed building */
|
|
999
1034
|
readonly building: "building";
|
|
1035
|
+
/** Queendomino: Wealth, 1 point per 3 unused coins */
|
|
1036
|
+
readonly wealth: "wealth";
|
|
1000
1037
|
/** Age of Giants: one quest tile */
|
|
1001
1038
|
readonly quest: "quest";
|
|
1002
1039
|
/** Origins Totem: one totem held by the player */
|
|
@@ -1373,6 +1410,8 @@ type GetValidKnightPositionsCommand = GetValidActionTargetsCommand;
|
|
|
1373
1410
|
type GetValidBuildingPositionsCommand = GetValidActionTargetsCommand;
|
|
1374
1411
|
/** Command for `getAffordableBuildings` (Queendomino `constructBuilding`). */
|
|
1375
1412
|
type GetAffordableBuildingsCommand = GetValidActionTargetsCommand;
|
|
1413
|
+
/** Command for `getValidDragonTargets` (Queendomino `useDragon`). */
|
|
1414
|
+
type GetValidDragonTargetsCommand = GetValidActionTargetsCommand;
|
|
1376
1415
|
/** Command for `getValidCavemanPlacements` (Origins Tribe `recruitCaveman`). */
|
|
1377
1416
|
type GetValidCavemanPlacementsCommand = GetValidActionTargetsCommand;
|
|
1378
1417
|
/** Command for `getValidGiantPositions` (Age of Giants `placeGiant`). */
|
|
@@ -1382,6 +1421,12 @@ type GetValidGiantTargetsCommand = GetValidActionTargetsCommand;
|
|
|
1382
1421
|
/** Command for `canSkipOptionalAction` (`skipOptionalAction`). */
|
|
1383
1422
|
type CanSkipOptionalActionCommand = GetValidActionTargetsCommand;
|
|
1384
1423
|
|
|
1424
|
+
/**
|
|
1425
|
+
* Command for `getValidDominoPicks` (`chooseDomino`): any game state and an
|
|
1426
|
+
* optional lord (default: the lord that must play).
|
|
1427
|
+
*/
|
|
1428
|
+
type GetValidDominoPicksCommand = GetValidActionTargetsCommand;
|
|
1429
|
+
|
|
1385
1430
|
/**
|
|
1386
1431
|
* Command to get all valid placements for a domino on a kingdom.
|
|
1387
1432
|
*/
|
|
@@ -1661,6 +1706,15 @@ type GameEngine = {
|
|
|
1661
1706
|
* @returns True if at least one valid placement exists
|
|
1662
1707
|
*/
|
|
1663
1708
|
canPlaceDomino: (command: CanPlaceDominoCommand) => boolean;
|
|
1709
|
+
/**
|
|
1710
|
+
* Numbers of the revealed dominoes `chooseDomino` accepts for the lord
|
|
1711
|
+
* (default: the lord to play): the dominoes not picked yet and, with the
|
|
1712
|
+
* Origins "Neolithic" rule, not reserved for the other player (the first
|
|
1713
|
+
* pick of each line takes the pair 1 & 4 or 2 & 3 for the lord's player).
|
|
1714
|
+
* @param command - Contains game state and optional lord ID
|
|
1715
|
+
* @returns Domino numbers, or [] when the game does not wait for this lord to pick
|
|
1716
|
+
*/
|
|
1717
|
+
getValidDominoPicks: (command: GetValidDominoPicksCommand) => number[];
|
|
1664
1718
|
/**
|
|
1665
1719
|
* Serializes the game state to a JSON string for persistence.
|
|
1666
1720
|
* @param command - Contains the game state to serialize
|
|
@@ -1739,7 +1793,8 @@ type GameEngine = {
|
|
|
1739
1793
|
getValidFireTokenPositions: (command: GetValidFireTokenPositionsCommand) => Position[];
|
|
1740
1794
|
/**
|
|
1741
1795
|
* Squares where `placeKnight` accepts a knight: squares of the domino just
|
|
1742
|
-
* placed
|
|
1796
|
+
* placed holding no knight yet, while the player still has a knight
|
|
1797
|
+
* available (Queendomino).
|
|
1743
1798
|
* @param command - Contains game state and optional lord ID
|
|
1744
1799
|
* @returns Valid positions, or [] when placeKnight is not the current action
|
|
1745
1800
|
*/
|
|
@@ -1758,6 +1813,15 @@ type GameEngine = {
|
|
|
1758
1813
|
* @returns Buildings to pass to constructBuilding, or [] when none applies
|
|
1759
1814
|
*/
|
|
1760
1815
|
getAffordableBuildings: (command: GetAffordableBuildingsCommand) => BuildingTile[];
|
|
1816
|
+
/**
|
|
1817
|
+
* Buildings of the Builders Board that `useDragon` accepts to burn
|
|
1818
|
+
* (Queendomino): every building of the board when the Dragon is still in
|
|
1819
|
+
* its cave this round, the lord does not host the Queen and can pay its
|
|
1820
|
+
* 1 coin.
|
|
1821
|
+
* @param command - Contains game state and optional lord ID
|
|
1822
|
+
* @returns Buildings to pass to useDragon, or [] when the Dragon cannot be used
|
|
1823
|
+
*/
|
|
1824
|
+
getValidDragonTargets: (command: GetValidDragonTargetsCommand) => BuildingTile[];
|
|
1761
1825
|
/**
|
|
1762
1826
|
* Valid `recruitCaveman` arguments: recruitable cavemen with every valid
|
|
1763
1827
|
* resource payment, and the squares for the caveman (Origins Tribe).
|
|
@@ -1917,6 +1981,19 @@ type GameEventCallbacks = {
|
|
|
1917
1981
|
lordId: string;
|
|
1918
1982
|
dominoNumber: number;
|
|
1919
1983
|
}) => void;
|
|
1984
|
+
/**
|
|
1985
|
+
* Called after the first pick of a line chose the Neolithic pair (Origins,
|
|
1986
|
+
* 2 players): `dominoNumbers` (pair 1 & 4 or 2 & 3) are reserved for the
|
|
1987
|
+
* picking lord's player, `opponentDominoNumbers` for the other player.
|
|
1988
|
+
* Emitted after `onDominoPicked`.
|
|
1989
|
+
*/
|
|
1990
|
+
onNeolithicPairChosen?: (event: {
|
|
1991
|
+
game: GameState;
|
|
1992
|
+
lordId: string;
|
|
1993
|
+
playerId: string;
|
|
1994
|
+
dominoNumbers: number[];
|
|
1995
|
+
opponentDominoNumbers: number[];
|
|
1996
|
+
}) => void;
|
|
1920
1997
|
/** Called after a lord places a domino on their kingdom */
|
|
1921
1998
|
onDominoPlaced?: (event: {
|
|
1922
1999
|
game: GameState;
|
|
@@ -2646,4 +2723,4 @@ type UseDragonUseCase = (game: GameWithNextAction, lordId: string, buildingId: n
|
|
|
2646
2723
|
*/
|
|
2647
2724
|
declare const createGameEngine: (config: Partial<EngineConfig>) => GameEngine;
|
|
2648
2725
|
|
|
2649
|
-
export { ACTION_LOG_VERSION, type ActionEntry, ActionExecutionError, type ActionPayloadMap, type ActionType, type AddExtraRulesCommand, type AddPlayersCommand, type AgeOfGiantsState, type BasicRules, type BotExtensionChoices, type BotStrategy, type BuildersBoard, type BuildingChoice, type BuildingContext, type BuildingSlot, type BuildingTile, type BuildingsRepository, type CalculatePlayerScoreCommand, type CalculatePlayerScoreUseCase, type CalculateScoreCommand, type CanPlaceDominoCommand, type CanSkipOptionalActionCommand, type CaveBoard, type CavemanChoice, type CavemanContext, type CavemanKind, type CavemanRecruitmentOption, type CavemanTile, type CavemenRepository, type ChooseDominoCommand, type ConstructBuildingCommand, type ConstructBuildingUseCase, type CreateGameCommand, type Crown, type DebugLogEntry, type DebugLogLevel, type DebugLogger, type DebugOptions, type DeserializeGameCommand, type DiscardDominoCommand, type DomainError, DomainException, type Domino, type DominoesRepository, type DragonContext, type DynastyGroupBy, type DynastyResult, type EmptyGround, type EmptyTile, type EndGameScoring, type EndGameScoringType, type EngineConfig, ErrorCode, type ErrorCodeType, type ExtensionContext, type ExtraRule, type FinalResult, type FireTokenContext, type FireTokenPool, GRIDSIZE, GROUND, type Game, type GameActionLog, type GameEngine, type GameEventCallbacks, type GameHistory, type GameMode, type GameSavePoint, type GameState, type GameStateResult, type GameStateSummary, type GameSteps, type GameWithNextAction, type GameWithNextStep, type GameWithResults, type GetAffordableBuildingsCommand, type GetDynastyResultCommand, type GetExtraRulesCommand, type GetModesCommand, type GetResultCommand, type GetValidActionTargetsCommand, type GetValidBuildingPositionsCommand, type GetValidCavemanPlacementsCommand, type GetValidFireTokenPositionsCommand, type GetValidGiantPositionsCommand, type GetValidGiantTargetsCommand, type GetValidKnightPositionsCommand, type GetValidPlacementsCommand, type GiantPositionContext, type Ground, type HunterGathererKind, type HunterGathererTile, type ImmediateBonus, type ImmediateBonusType, InvalidStepError, type Kingdom, type Knight, type KnightContext, type Logger, type Lord, MAX_KINGDOM_SIZE, type ModeRepository, type NextAction, type NextStep, NotFoundError, type ObjectValues, type OriginsState, type OriginsSubMode, type PendingFireToken, type PendingGiant, type PickContext, type PlaceContext, type PlaceDominoCommand, type PlaceFireTokenCommand, type PlaceFireTokenUseCase, type PlaceGiantCommand, type PlaceGiantUseCase, type PlaceKnightCommand, type PlaceKnightUseCase, type PlacedBuilding, type PlacedCaveman, type PlacedFireToken, type PlacedGiant, type Player, type PlayerActions, type PlayerInput, type PlayerPayload, type PlayerScore, type Players, type PlayersPayload, type Position, type QueenDominoState, type QuestTile, type QuestTilesRepository, type QuestType, type RecruitCavemanCommand, type RecruitCavemanUseCase, RedoError, type Resource, type ResourceType, type RevealsDomino, type Rotation, type RuleRepository, type Rules, type Score, type ScoreBonus, type ScoreBonusType, type ScoreBreakdown, type ScoreResult, type ScoreTerritory, type SelectedRules, type SendGiantChoice, type SendGiantCommand, type SendGiantContext, type SendGiantUseCase, type SerializeGameCommand, type ShuffleMethod, type SkipOptionalActionCommand, type SkipOptionalActionUseCase, type StartGameCommand, StepExecutionError, type StrategyName, type SupportedLocale, type Tile, type TotemBonus, type TotemState, TranslationKey, type TranslationKeyType, type Translator, UndoError, type UseDragonCommand, type UseDragonUseCase, type UuidMethod, type ValidActionTargetsUseCase, type ValidCavemanPlacements, type ValidGiantTargets, type ValidPlacement, ValidationError, type ValidationIssue, type ValidationSeverity, WARRIOR_POWER, type WarriorTile, type WarriorType, advancedStrategy, appendAction, canRedo, canUndo, cavemanKindToTranslationKey, cavemanKinds, clearHistory, createActionLog, createDomainError, createGameEngine, createGameHistory, createSavePoint, createTranslator, defaultTranslations, defaultTranslator, deserializeGame, englishTranslations, errorCodeToTranslationKey, expertStrategy, extraRuleNameToTranslationKey, frenchTranslations, gameSteps, getActions, getActionsByTurn, getActionsByType, getHistorySize, getStrategy, getStrategyNames, greedyStrategy, groundToTranslationKey, hunterGathererKindToTranslationKey, hunterGathererKinds, isBotTurn, isGameWithNextAction, isGameWithNextStep, isGameWithResults, isHunterGathererTile, isSkippableAction, isWarriorTile, localeTranslations, modeNameToTranslationKey, originsSubModes, playBotTurn, playBotTurns, playerActionToTranslationKey, playerActions, pushState, questTypeToTranslationKey, questTypes, randomStrategy, redo, replayActions, resourceToTranslationKey, resourceTypes, restoreFromSavePoint, scoreBonusTypes, serializeGame, summarizeGameState, supportedLocales, totemToTranslationKey, translateErrorCode, undo, validateGameState, warriorTypeToTranslationKey, warriorTypes, wrapWithActionLog, wrapWithDebug, wrapWithEvents };
|
|
2726
|
+
export { ACTION_LOG_VERSION, type ActionEntry, ActionExecutionError, type ActionPayloadMap, type ActionType, type AddExtraRulesCommand, type AddPlayersCommand, type AgeOfGiantsState, type BasicRules, type BotExtensionChoices, type BotStrategy, type BuildersBoard, type BuildingChoice, type BuildingContext, type BuildingSlot, type BuildingTile, type BuildingsRepository, type CalculatePlayerScoreCommand, type CalculatePlayerScoreUseCase, type CalculateScoreCommand, type CanPlaceDominoCommand, type CanSkipOptionalActionCommand, type CaveBoard, type CavemanChoice, type CavemanContext, type CavemanKind, type CavemanRecruitmentOption, type CavemanTile, type CavemenRepository, type ChooseDominoCommand, type ConstructBuildingCommand, type ConstructBuildingUseCase, type CreateGameCommand, type Crown, type DebugLogEntry, type DebugLogLevel, type DebugLogger, type DebugOptions, type DeserializeGameCommand, type DiscardDominoCommand, type DomainError, DomainException, type Domino, type DominoesRepository, type DragonContext, type DynastyGroupBy, type DynastyResult, type EmptyGround, type EmptyTile, type EndGameScoring, type EndGameScoringType, type EngineConfig, ErrorCode, type ErrorCodeType, type ExtensionContext, type ExtraRule, type FinalResult, type FireTokenContext, type FireTokenPool, GRIDSIZE, GROUND, type Game, type GameActionLog, type GameEngine, type GameEventCallbacks, type GameHistory, type GameMode, type GameSavePoint, type GameState, type GameStateResult, type GameStateSummary, type GameSteps, type GameWithNextAction, type GameWithNextStep, type GameWithResults, type GetAffordableBuildingsCommand, type GetDynastyResultCommand, type GetExtraRulesCommand, type GetModesCommand, type GetResultCommand, type GetValidActionTargetsCommand, type GetValidBuildingPositionsCommand, type GetValidCavemanPlacementsCommand, type GetValidDominoPicksCommand, type GetValidDragonTargetsCommand, type GetValidFireTokenPositionsCommand, type GetValidGiantPositionsCommand, type GetValidGiantTargetsCommand, type GetValidKnightPositionsCommand, type GetValidPlacementsCommand, type GiantPositionContext, type Ground, type HunterGathererKind, type HunterGathererTile, type ImmediateBonus, type ImmediateBonusType, InvalidStepError, type Kingdom, type Knight, type KnightContext, type Logger, type Lord, MAX_KINGDOM_SIZE, type ModeRepository, type NextAction, type NextStep, NotFoundError, type ObjectValues, type OriginsState, type OriginsSubMode, type PendingFireToken, type PendingGiant, type PickContext, type PlaceContext, type PlaceDominoCommand, type PlaceFireTokenCommand, type PlaceFireTokenUseCase, type PlaceGiantCommand, type PlaceGiantUseCase, type PlaceKnightCommand, type PlaceKnightUseCase, type PlacedBuilding, type PlacedCaveman, type PlacedFireToken, type PlacedGiant, type Player, type PlayerActions, type PlayerInput, type PlayerPayload, type PlayerScore, type Players, type PlayersPayload, type Position, type QueenDominoState, type QuestTile, type QuestTilesRepository, type QuestType, type RecruitCavemanCommand, type RecruitCavemanUseCase, RedoError, type Resource, type ResourceType, type RevealsDomino, type Rotation, type RuleRepository, type Rules, type Score, type ScoreBonus, type ScoreBonusType, type ScoreBreakdown, type ScoreResult, type ScoreTerritory, type SelectedRules, type SendGiantChoice, type SendGiantCommand, type SendGiantContext, type SendGiantUseCase, type SerializeGameCommand, type ShuffleMethod, type SkipOptionalActionCommand, type SkipOptionalActionUseCase, type StartGameCommand, StepExecutionError, type StrategyName, type SupportedLocale, type Tile, type TotemBonus, type TotemState, TranslationKey, type TranslationKeyType, type Translator, UndoError, type UseDragonCommand, type UseDragonUseCase, type UuidMethod, type ValidActionTargetsUseCase, type ValidCavemanPlacements, type ValidGiantTargets, type ValidPlacement, ValidationError, type ValidationIssue, type ValidationSeverity, WARRIOR_POWER, type WarriorTile, type WarriorType, advancedStrategy, appendAction, canRedo, canUndo, cavemanKindToTranslationKey, cavemanKinds, clearHistory, createActionLog, createDomainError, createGameEngine, createGameHistory, createSavePoint, createTranslator, defaultTranslations, defaultTranslator, deserializeGame, englishTranslations, errorCodeToTranslationKey, expertStrategy, extraRuleNameToTranslationKey, frenchTranslations, gameSteps, getActions, getActionsByTurn, getActionsByType, getHistorySize, getStrategy, getStrategyNames, greedyStrategy, groundToTranslationKey, hunterGathererKindToTranslationKey, hunterGathererKinds, isBotTurn, isGameWithNextAction, isGameWithNextStep, isGameWithResults, isHunterGathererTile, isSkippableAction, isWarriorTile, localeTranslations, modeNameToTranslationKey, originsSubModes, playBotTurn, playBotTurns, playerActionToTranslationKey, playerActions, pushState, questTypeToTranslationKey, questTypes, randomStrategy, redo, replayActions, resourceToTranslationKey, resourceTypes, restoreFromSavePoint, scoreBonusTypes, serializeGame, summarizeGameState, supportedLocales, totemToTranslationKey, translateErrorCode, undo, validateGameState, warriorTypeToTranslationKey, warriorTypes, wrapWithActionLog, wrapWithDebug, wrapWithEvents };
|