20 lines
494 B
Lua
20 lines
494 B
Lua
local FormationData = class("FormationData", BaseData)
|
|
|
|
function FormationData:init(data)
|
|
self.formations = data and data.formations or {}
|
|
end
|
|
|
|
function FormationData:getStageFormation()
|
|
return self:getFormation(GConst.BattleConst.BATTLE_TYPE.STAGE)
|
|
end
|
|
|
|
function FormationData:getFormation(formationType)
|
|
local formation = self.formations[formationType]
|
|
if formation == nil then
|
|
formation = {}
|
|
self.formations[formationType] = formation
|
|
end
|
|
return formation
|
|
end
|
|
|
|
return FormationData |