- 바둑: 9·13·19줄, 따내기·자충수 금지·슈퍼코(Zobrist)/한국식 삼패 무승부, 접바둑·덤, 패스, 사석 확인 단계(자동 제안·동의·이의 시 재개), 집/영역 계가, 초읽기·피셔 시계 (테스트 50개) - 쓰이지 않던 바둑 옵션(연결 끊김 유예 — 방 설정이 담당) 제거 - 홈 '방 만들기'가 게임 고르기 창을 거치도록 바뀐 것에 맞춰 E2E 수정, 장기 상차림 단계 E2E 안정화 - 전체: 테스트 230개, E2E 오목·관리자·4게임·접근성 모두 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
789 B
TypeScript
27 lines
789 B
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'),
|
|
};
|
|
|
|
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;
|
|
}
|