Bridge Core
Teaching
Teaching modes and pedagogy configuration.
Teaching Modes
The teaching mode controls which game features are active. See Game Modes for the full list of modes and their CoreConfig overrides.
Teaching Module
Access teaching logic through the engine's teaching module:
import { createBridgeEngine } from '@workspace/bridge-core';
const engine = createBridgeEngine({ teachingMode: 'h' });
engine.teaching.mode; // "h"
engine.teaching.variant; // "classic"
engine.teaching.areAuctionsEnabled('h', true); // true (restricted to NT)
engine.teaching.areAuctionsEnabled('auction', false); // false (teachDummy=false disables auctions)
engine.teaching.isAuctionModeEnabled(true); // true
engine.teaching.parseTeaching('auction'); // "auction"
engine.teaching.parseTeaching('invalid'); // null| Method | Description |
|---|---|
mode | Current teaching mode (getter) |
variant | Current suit variant — "classic" or "petit-bridge" (getter) |
areAuctionsEnabled(mode, teachDummy) | Whether auctions are enabled for this mode |
isAuctionModeEnabled(teachDummy) | Whether the auction mode selector should be enabled |
getValidBidSuits(mode) | Returns restricted bid suits (e.g. ["NT"] for minibridge) or undefined |
getVariantForMode(mode) | Returns "petit-bridge" or "classic" |
parseTeaching(value) | Parses a string into a valid TeachingMode or null |
Pedagogy Groups
Teaching modes are organized into pedagogy groups for progressive learning:
engine.teaching.PEDAGOGY_GROUP_IDS; // group identifiers
engine.teaching.PEDAGOGY_GROUPS; // full group definitions with modesConstants
The teaching module also exposes these constants:
| Constant | Description |
|---|---|
AUCTIONS | List of auction-related teaching modes |
TEACH_MODES | All available teaching modes |
TEACHING_MODE_VALUES | Teaching mode string values (for validation/parsing) |
DEFAULT_AUCTION_MODE | Default auction mode |
DEFAULT_TEACH_DUMMY | Default teach-dummy flag value |
PEDAGOGY_GROUP_IDS | Pedagogy group identifiers |
PEDAGOGY_GROUPS | Full pedagogy group definitions with their modes |