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