20 lines
656 B
Lua
20 lines
656 B
Lua
local FormationManager = class("FormationManager", BaseModule)
|
|
|
|
function FormationManager:upHeroToStageFormation(heroId, matchType)
|
|
local formation = DataManager.FormationData:getStageFormation()
|
|
if formation[matchType] == heroId then
|
|
return
|
|
end
|
|
local args = {
|
|
formationType = GConst.BattleConst.BATTLE_TYPE.STAGE,
|
|
matchType = matchType,
|
|
heroId = heroId
|
|
}
|
|
ServerDataManager:dataOperate(GConst.ServerDataConst.DATA_OP_BEHAVIOR.UPDATE_FORMATION, args, function(msgData)
|
|
if msgData.status == 0 then
|
|
DataManager.FormationData:upHeroToFormation(GConst.BattleConst.BATTLE_TYPE.STAGE, matchType, heroId)
|
|
end
|
|
end)
|
|
end
|
|
|
|
return FormationManager |