export type GameId = 'chexuan' | 'mahjong';

export interface GameRoom {
  id: string;
  name: string;
  baseChip: number;
  online: number;
  capacity: number;
  badge: string;
  description: string;
}

export interface GameOption {
  id: GameId;
  name: string;
  subtitle: string;
  badge: string;
  description: string;
  accent: string;
}

export const GAME_OPTIONS: GameOption[] = [
  {
    id: 'chexuan',
    name: '扯旋',
    subtitle: '丁二皇 · 德扑式对局',
    badge: '热门',
    description: '节奏快、对抗强，适合喜欢明暗博弈的玩家。',
    accent: 'gold',
  },
  {
    id: 'mahjong',
    name: '麻将',
    subtitle: '红中断勾卡 · 四川血战到底',
    badge: '新开',
    description: '先搭建桌面交互与牌型质感，后续再接规则。',
    accent: 'jade',
  },
];

export const ROOM_PRESETS: Record<GameId, GameRoom[]> = {
  chexuan: [
    {
      id: 'cx-01',
      name: '新手场',
      baseChip: 10,
      online: 284,
      capacity: 500,
      badge: '稳健体验',
      description: '适合熟悉扯旋节奏与牌桌质感。',
    },
    {
      id: 'cx-02',
      name: '初级场',
      baseChip: 20,
      online: 412,
      capacity: 500,
      badge: '推荐',
      description: '节奏更快，适合常规娱乐局。',
    },
    {
      id: 'cx-03',
      name: '中级场',
      baseChip: 50,
      online: 176,
      capacity: 400,
      badge: '高热',
      description: '更高底注，围绕筹码的对抗更紧凑。',
    },
    {
      id: 'cx-04',
      name: '高级场',
      baseChip: 100,
      online: 88,
      capacity: 300,
      badge: '高倍',
      description: '给想要更大压力与更强刺激的玩家。',
    },
  ],
  mahjong: [
    {
      id: 'mj-01',
      name: '新手场',
      baseChip: 10,
      online: 358,
      capacity: 600,
      badge: '教学',
      description: '先体验四川麻将桌面交互与牌池布局。',
    },
    {
      id: 'mj-02',
      name: '初级场',
      baseChip: 20,
      online: 266,
      capacity: 500,
      badge: '常规',
      description: '标准桌面节奏，适合轻松开局。',
    },
    {
      id: 'mj-03',
      name: '中级场',
      baseChip: 50,
      online: 139,
      capacity: 400,
      badge: '活跃',
      description: '高一点底注，桌面质感更接近正式局。',
    },
    {
      id: 'mj-04',
      name: '高级场',
      baseChip: 100,
      online: 73,
      capacity: 300,
      badge: '巅峰',
      description: '仅做 UI 演示，后续可接入真实麻将规则。',
    },
  ],
};

export const DEFAULT_ROOM_BY_GAME: Record<GameId, GameRoom> = {
  chexuan: ROOM_PRESETS.chexuan[1],
  mahjong: ROOM_PRESETS.mahjong[1],
};

export function getGameOption(gameId: GameId): GameOption {
  const option = GAME_OPTIONS.find((item) => item.id === gameId);
  return option ?? GAME_OPTIONS[0];
}
