parent
0e86945c53
commit
ac319513dc
|
|
@ -64,21 +64,27 @@ end
|
|||
|
||||
--刷新编队数据
|
||||
function this.UpdateFormation(msg)
|
||||
Log("编队数量:" .. #msg.TeamPosInfo)
|
||||
this.formationList = {}
|
||||
-- this.curFormationIndex = this.SetCurFormationIndex()
|
||||
this.curFormationIndex = 1
|
||||
for i, team in ipairs(msg.TeamPosInfo) do
|
||||
LogGreen("team.teamId:"..team.teamId)
|
||||
local isRefresh = false
|
||||
local oTeam = this.MakeAEmptyTeam(team.teamId)
|
||||
|
||||
for j = 1, #team.teamHeroInfos do
|
||||
local teamHeroInfo = team.teamHeroInfos[j]
|
||||
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
|
||||
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
|
||||
if HeroManager.GetSingleHeroData(teamHeroInfo.heroId) then
|
||||
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
|
||||
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
|
||||
else
|
||||
isRefresh = true
|
||||
end
|
||||
end
|
||||
oTeam.teamPokemonInfos = {}
|
||||
this.formationList[team.teamId] = oTeam
|
||||
if isRefresh then
|
||||
FormationManager.RefreshFormation(team.teamId, this.formationList[team.teamId].teamHeroInfos, {})
|
||||
end
|
||||
end
|
||||
|
||||
if #msg.TeamPosInfo == 0 then
|
||||
|
|
@ -205,7 +211,9 @@ function this.GetFormationByID(teamId)
|
|||
local _v=tonumber(v)
|
||||
if teamId==_v and #this.formationList[teamId].teamHeroInfos<=0 then
|
||||
for n = 1, #this.formationList[1].teamHeroInfos do
|
||||
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
|
||||
if HeroManager.GetSingleHeroData(this.formationList[1].teamHeroInfos.heroId) then
|
||||
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
|
||||
end
|
||||
end
|
||||
--
|
||||
FormationManager.RefreshFormation(teamId, this.formationList[teamId].teamHeroInfos, {})
|
||||
|
|
|
|||
Loading…
Reference in New Issue