Files
mahjong-web/src/store/state.ts
wsy182 be9bd8c76d feat(game): 添加成都麻将房间配置和桌面牌面显示功能
- 在房间创建接口中添加总回合数配置选项
- 实现桌面弃牌区域的可视化展示,区分各玩家的弃牌和组合
- 添加缺门标识显示,帮助玩家识别缺门牌组起始位置
- 优化牌面操作状态管理,增加弃牌等待状态和超时处理机制
- 更新样式布局适配新的桌面牌面区域,调整墙体和桌面对齐方式
- 修复多处牌面状态同步问题,确保游戏流程中的界面一致性
2026-03-29 23:56:32 +08:00

53 lines
1.1 KiB
TypeScript

// 房间玩家状态
export interface RoomPlayerState {
index: number
playerId: string
displayName?: string
missingSuit?: string | null
ready: boolean
trustee?: boolean
hand: string[]
melds: string[]
outTiles: string[]
hasHu: boolean
}
// 房间整体状态
export interface ActiveRoomState {
roomId: string
roomName: string
gameType: string
ownerId: string
maxPlayers: number
playerCount: number
status: string
createdAt: string
updatedAt: string
players: RoomPlayerState[]
myHand: string[]
game?: {
state?: {
wall?: string[]
scores?: Record<string, number>
dealerIndex?: number
currentTurn?: number
phase?: string
}
}
}
export interface ActiveRoomSelectionInput {
roomId: string
roomName?: string
gameType?: string
ownerId?: string
maxPlayers?: number
playerCount?: number
status?: string
createdAt?: string
updatedAt?: string
players?: RoomPlayerState[]
myHand?: string[]
game?: ActiveRoomState['game']
}