docs(server): correct translateMove audience docs after the 'both' change
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -112,7 +112,7 @@ function announceWith(
|
||||
text: 'no_such_piece' | 'no_legal_moves' | 'wont_help' | 'illegal_move',
|
||||
): CommitResult {
|
||||
const ply = game.chess.history().length;
|
||||
// Feature 1: attempted moves are announced to both players.
|
||||
// Attempted moves are part of the shared moderator transcript — both players hear them.
|
||||
const a = announce(text, 'both', ply);
|
||||
game.announcements.push(a);
|
||||
return { kind: 'announce', announcements: [a] };
|
||||
|
||||
@@ -14,10 +14,11 @@ export function announce(
|
||||
/**
|
||||
* Translate an applied chess.js Move into the moderator vocabulary.
|
||||
*
|
||||
* Capturing player learns the captured piece type via their `view` update
|
||||
* (their canonical board reflects the capture; the captured-pieces tray is
|
||||
* populated from move history). The opponent gets only the `*_moved_captured`
|
||||
* announcement.
|
||||
* Every announcement is emitted with audience 'both' — the moderator speaks
|
||||
* each event aloud and both players hear it. Move events carry no square
|
||||
* coordinates, so a player learns *that* the opponent moved / captured /
|
||||
* castled, never *where*. The capturing player additionally sees the capture
|
||||
* reflected in their own view update.
|
||||
*/
|
||||
export function translateMove(game: Game, move: Move): Announcement[] {
|
||||
const out: Announcement[] = [];
|
||||
@@ -33,8 +34,7 @@ export function translateMove(game: Game, move: Move): Announcement[] {
|
||||
const isQueensideCastle = move.isQueensideCastle();
|
||||
const isProm = !!move.promotion;
|
||||
|
||||
// To both players: the move event itself (Feature 1 — the moderator
|
||||
// announces every move aloud; both players hear it).
|
||||
// The move event itself — the moderator announces every move aloud, so both players hear it.
|
||||
if (isKingsideCastle) {
|
||||
out.push(announce(`${moverWord}_castled_kingside` as ModeratorText, 'both', ply));
|
||||
} else if (isQueensideCastle) {
|
||||
|
||||
Reference in New Issue
Block a user