Game Modes
One section per teaching mode — each shows only the properties that differ from the base config.
Import from @workspace/bridge-core/constants.
Each game mode defines a CoreConfig that controls card counts, valid ranks, auction rules, and bid restrictions. The engine resolves the appropriate config from the teachingMode in BridgeContext.
import { createBridgeEngine } from '@workspace/bridge-core';
const engine = createBridgeEngine({ teachingMode: 'auction' });
engine.hands.config; // CoreConfig for this modeCoreConfig
Prop
Type
Base Config
DEFAULT_CORE_CONFIG — the reference point every mode extends from.
| Property | Value |
|---|---|
nbCardsPerHand | 13 |
validRanks | A K Q J T 9 8 7 6 5 4 3 2 |
auctions | "interactive" |
validBidSuits | BID_SUITS (C D H S NT) |
dummyVisible | true |
| variant | classic |
auction
Full interactive auction — the standard bridge experience. This is the base config with no overrides.
The contract is bid normally and displayed in the player along with the goal (number of tricks NS must make, which may differ from the number required to make the contract).
const engine = createBridgeEngine({ teachingMode: 'auction' });
engine.hands.config.nbCardsPerHand; // 13
engine.hands.config.auctions; // "interactive"sequence
Same as auction, except the user does not interact — the bid sequence is predefined in the editor and displayed by the system.
| Property | Value |
|---|---|
auctions | "sequence" |
const engine = createBridgeEngine({ teachingMode: 'sequence' });
engine.hands.config.auctions; // "sequence"show-trump
No auction. The trump suit set by the author is displayed to the player without the goal — e.g. "Jeu à l'atout Carreau".
| Property | Value |
|---|---|
auctions | "trump" |
const engine = createBridgeEngine({ teachingMode: 'show-trump' });
engine.hands.config.auctions; // "trump"show-trump-goal
No auction. The trump suit and the target number of tricks set by the author are displayed — e.g. "But : 10 levées à l'atout Pique".
| Property | Value |
|---|---|
auctions | "goal" |
const engine = createBridgeEngine({ teachingMode: 'show-trump-goal' });
engine.hands.config.auctions; // "goal"show-contract
Like show-trump-goal, but displays the full contract instead of just the trump suit — e.g. "Contrat : 3SA, but : 10 levées".
| Property | Value |
|---|---|
auctions | "contract" |
const engine = createBridgeEngine({ teachingMode: 'show-contract' });
engine.hands.config.auctions; // "contract"no-auction
Standard bridge deck with auctions disabled. Nothing is shown to the player (no trump, no contract, no goal). The trump suit comes from the deal's contract if one is set. The goal equals the maximum number of tricks achievable by NS on the deal (used for awarding stars).
| Property | Value |
|---|---|
auctions | false |
const engine = createBridgeEngine({ teachingMode: 'no-auction' });
engine.hands.config.auctions; // falseno-dummy
Same as no-auction, but the dummy hand is also hidden from the player.
| Property | Value |
|---|---|
auctions | false |
dummyVisible | false |
const engine = createBridgeEngine({ teachingMode: 'no-dummy' });
engine.hands.config.auctions; // false
engine.hands.config.dummyVisible; // falseh
Minibridge variant — No Trump only. No auction: instead, the user calculates the contract based on their cards and partner information displayed on screen (card count per suit, H points). The contract and goal are displayed in the player.
| Property | Value |
|---|---|
validBidSuits | ["NT"] |
const engine = createBridgeEngine({ teachingMode: 'h' });
engine.hands.config.auctions; // "interactive"
engine.hands.config.validBidSuits; // ["NT"]hd / hld
Same as h, but any suit is available. Partner information always shows H points (not HL or HLD).
| Property | Value |
|---|---|
auctions | "contract" |
const engine = createBridgeEngine({ teachingMode: 'hd' });
engine.hands.config.auctions; // "contract"petit-bridge
Simplified variant with a reduced 40-card deck (10 cards per hand). Ranks 2, 3, 4 are removed and auctions, contract, trump are disabled. The goal should be displayed but this is not yet implemented.
| Property | Value |
|---|---|
nbCardsPerHand | 10 |
validRanks | A K Q J T 9 8 7 6 5 |
auctions | false |
| variant | petit-bridge |
const engine = createBridgeEngine({ teachingMode: 'petit-bridge' });
engine.hands.config.nbCardsPerHand; // 10
engine.hands.config.auctions; // falseIn petit-bridge, ranks are displayed as numbers 1–10 regardless of locale:
| Standard rank | A | K | Q | J | T | 9 | 8 | 7 | 6 | 5 |
|---|---|---|---|---|---|---|---|---|---|---|
| Display | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |