Files
joke-app/apps/web/src/games/registry.ts
EJClaw 74a7daa4d3 새 게임 라이어 게임: 규칙 엔진·말하는 컴퓨터·화면·도움말·문서·E2E
- packages/games/src/liar: 주제 10개 제시어 은행, 설명(두 번째 바퀴 거꾸로)·자유 토론·투표(동점 재투표 한 번, 또 동점이면 라이어 승리)·라이어 정답 맞히기(띄어쓰기·다른 표기 무시), 바보 모드
- 컴퓨터: 마피아처럼 live 전략, 레벨 1~60을 LiveBotInput.level 로 받음(서버 BotDriver 가 넘김), BOT_CHAT_REQUIRED 에 추가
- 웹: 꾹 누르는 제시어 카드, 설명 기록·토론 채팅·투표 화면, 30초 요약, [?] 도움말
- 문서 docs/games/liar.md, 등록(GAMES·CATALOG·BOT_GAMES·registry·아이콘), 서버 방 테스트, E2E(거절 알림이 저절로 사라지는지 확인 포함)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:17:14 +09:00

54 lines
1.8 KiB
TypeScript

import type { GameUI } from './types';
/** Game screens are code-split: each is downloaded only when that game is opened (docs/09 §6). */
export const GAME_UI: Record<string, () => Promise<{ default: GameUI }>> = {
omok: () => import('./omok'),
othello: () => import('./othello'),
chess: () => import('./chess'),
janggi: () => import('./janggi'),
baduk: () => import('./baduk'),
seotda: () => import('./seotda'),
poker: () => import('./poker'),
yacht: () => import('./yacht'),
yut: () => import('./yut'),
'one-card': () => import('./one-card'),
rummikub: () => import('./rummikub'),
'davinci-code': () => import('./davinci-code'),
mahjong: () => import('./mahjong'),
gostop: () => import('./gostop'),
bang: () => import('./bang'),
'halli-galli': () => import('./halli-galli'),
marble: () => import('./marble'),
dalmuti: () => import('./dalmuti'),
splendor: () => import('./splendor'),
quoridor: () => import('./quoridor'),
'las-vegas': () => import('./las-vegas'),
'cockroach-poker': () => import('./cockroach-poker'),
'ninety-nine': () => import('./ninety-nine'),
'connect-four': () => import('./connect-four'),
'old-maid': () => import('./old-maid'),
dobble: () => import('./dobble'),
catchmind: () => import('./catchmind'),
mafia: () => import('./mafia'),
apple: () => import('./apple'),
clue: () => import('./clue'),
uno: () => import('./uno'),
liar: () => import('./liar'),
};
const cache = new Map<string, GameUI>();
export async function loadGameUI(id: string): Promise<GameUI | null> {
const hit = cache.get(id);
if (hit) return hit;
const loader = GAME_UI[id];
if (!loader) return null;
const mod = (await loader()).default;
cache.set(id, mod);
return mod;
}
export function cachedGameUI(id: string): GameUI | null {
return cache.get(id) ?? null;
}