refactor(game): 移除废弃的房间状态管理文件并优化游戏页面
- 删除 src/state/active-room.ts 文件及其相关导入引用 - 更新 ChengduGamePage.vue 中的导入路径从 features/chengdu-game/useChengduGameRoom 到 game/chengdu - 移除 ChengduGamePage.vue 中不再需要的状态变量如 roomId、startGamePending 等 - 简化 roomStatusText 计算属性逻辑,移除 "等待中" 默认值 - 调整 phaseLabelMap 映射,移除 "摸牌" 阶段显示 - 删除多个废弃的计算属性如 centerTimer、selectedTileText、pendingClaimText 等 - 移除 actionTheme 函数及相关的按钮样式绑定 - 清理游戏场景中的装饰元素如 diamond outline、scene watermark、center desk 等 - 更新 HallPage.vue 中的导入路径到 store/active-room-store - 添加缺失的玩家数据字段如 hand、melds、outTiles、hasHu - 调整 CSS 样式包括工具栏位置、动画角度和时钟位置等视觉优化
This commit is contained in:
@@ -4,8 +4,8 @@ import { useRouter } from 'vue-router'
|
||||
import { AuthExpiredError, type AuthSession } from '../api/authed-request'
|
||||
import { createRoom, joinRoom, listRooms, type RoomItem } from '../api/mahjong'
|
||||
import { getUserInfo, type UserInfo } from '../api/user'
|
||||
import { hydrateActiveRoomFromSelection } from '../state/active-room'
|
||||
import type { RoomPlayerState } from '../state/active-room'
|
||||
import { hydrateActiveRoomFromSelection } from '../store/active-room-store'
|
||||
import type { RoomPlayerState } from '../store/active-room-store'
|
||||
import type { StoredAuth } from '../types/session'
|
||||
import { clearAuth, readStoredAuth, writeStoredAuth } from '../utils/auth-storage'
|
||||
|
||||
@@ -129,6 +129,10 @@ function mapRoomPlayers(room: RoomItem): RoomPlayerState[] {
|
||||
index: Number.isFinite(item.index) ? item.index : fallbackIndex,
|
||||
playerId: item.player_id,
|
||||
ready: Boolean(item.ready),
|
||||
hand: [],
|
||||
melds: [],
|
||||
outTiles: [],
|
||||
hasHu: false,
|
||||
}))
|
||||
.filter((item) => Boolean(item.playerId))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user