--[[ 公平竞技3V3赛制信息 ]] local TeamFairChampionshipToalMatchInfo = class("TeamFairChampionshipToalMatchInfo") function TeamFairChampionshipToalMatchInfo:initialize() --服务器协议数据,外部只允许访问 self.serverInfo = {} self.dicMatchStageInfo = {} self.myStageMatchGroupArr = {} end function TeamFairChampionshipToalMatchInfo:SetServerInfo(serverInfo) self.serverInfo = serverInfo end function TeamFairChampionshipToalMatchInfo:GetBigMatchStartTime(bigMatchStageId) return self.serverInfo.matchTime[bigMatchStageId].matchStartTime end function TeamFairChampionshipToalMatchInfo:SetServerMatchStageInfo(serverStageInfo, myStageMatchGroup) self.dicMatchStageInfo[serverStageInfo.stageId] = serverStageInfo self.myStageMatchGroupArr[serverStageInfo.stageId] = myStageMatchGroup self.serverInfo.curStageState = serverStageInfo.state end function TeamFairChampionshipToalMatchInfo:GetMatchStageInfo(stageId) return self.dicMatchStageInfo[stageId] end function TeamFairChampionshipToalMatchInfo:GetCurMatchStageState() return self.serverInfo.curStageState end function TeamFairChampionshipToalMatchInfo:UpdateMatchStageInfo(serverChangeInfo) self.serverInfo.curMatchId = serverChangeInfo.curMatchId self.serverInfo.curStage = serverChangeInfo.curStage self.serverInfo.curStageState = serverChangeInfo.state self:UpdateStageState(self.serverInfo.curStage, serverChangeInfo) end function TeamFairChampionshipToalMatchInfo:UpdateStageState(stageId, serverStateInfo) local localMatchStageInfo = self:GetMatchStageInfo(stageId) if localMatchStageInfo then localMatchStageInfo.state = serverStateInfo.state localMatchStageInfo.turn = serverStateInfo.turn localMatchStageInfo.stateEndTime = serverStateInfo.stateEndTime localMatchStageInfo.stateStartTime = serverStateInfo.stateStartTime end end --更新赛制小阶段的小组信息 function TeamFairChampionshipToalMatchInfo:UpdateMatchGroupInfo(stageId, serverChangeGroupChangeList) local localMatchStageInfo = self:GetMatchStageInfo(stageId) if not localMatchStageInfo then return end for __, serverChangeGroup in ipairs(serverChangeGroupChangeList) do for __, localGroupInfo in ipairs(localMatchStageInfo.groupInfo) do if localGroupInfo.matchGroupId==serverChangeGroup.matchGroupId and localGroupInfo.groupId==serverChangeGroup.groupId then localGroupInfo.isBattleEnd = serverChangeGroup.isBattleEnd if not string.isNilOrEmpty(serverChangeGroup.teamId) then if localGroupInfo.teamInfos[1].teamId == serverChangeGroup.teamId then localGroupInfo.teamInfos[1].winNum = serverChangeGroup.winNum elseif localGroupInfo.teamInfos[2].teamId == serverChangeGroup.teamId then localGroupInfo.teamInfos[2].winNum = serverChangeGroup.winNum end end break end end end end return TeamFairChampionshipToalMatchInfo