local RechargeTemplate = BaseClass("RechargeTemplate")

function RechargeTemplate:__init()
  self.id = 0
  self.type = 0
  self.order = 0
  self.hot = 0
  self.name = ""
  self.image = ""
  self.image1 = ""
  self.icon = ""
  self.banner = ""
  self.icon_order = 0
  self.entry_type = 0
  self.para1 = ""
  self.para2 = ""
  self.unlock_lv = 0
  self.show_icon = 0
  self.onoff = 0
  self.login_open_forbid = 0
  self.banner_bg_new = ""
  self.banner_pic_new = {}
  self.banner_pic_init_size = {}
  self.bg_pic_init_size = {}
  self.board_color = 0
  self.column_type = 0
  self.resource_config1_list = {}
  self.resource_config2_list = {}
  self.bg_effect_name = ""
  self.for_effect_name = ""
  self.icon_ani = ""
end

function RechargeTemplate:__delete()
  self.id = nil
  self.type = nil
  self.order = nil
  self.hot = nil
  self.name = nil
  self.image = nil
  self.image1 = nil
  self.icon = nil
  self.banner = nil
  self.icon_order = nil
  self.entry_type = nil
  self.para1 = nil
  self.para2 = nil
  self.unlock_lv = nil
  self.show_icon = nil
  self.onoff = nil
  self.login_open_forbid = nil
  self.banner_bg_new = nil
  self.banner_pic_new = nil
  self.banner_pic_init_size = nil
  self.bg_pic_init_size = nil
  self.board_color = nil
  self.column_type = nil
  self.resource_config1_list = nil
  self.resource_config2_list = nil
  self.bg_effect_name = nil
  self.for_effect_name = nil
  self.icon_ani = nil
end

function RechargeTemplate:InitData(row)
  if row == nil then
    return
  end
  self.id = tonumber(row:getValue("id")) or 0
  self.type = tonumber(row:getValue("type")) or 0
  self.order = tonumber(row:getValue("order")) or 0
  self.hot = tonumber(row:getValue("hot")) or 0
  self.name = row:getValue("name") or ""
  self.image = row:getValue("image") or ""
  self.image1 = row:getValue("image1") or ""
  self.icon = row:getValue("icon") or ""
  self.banner = row:getValue("banner") or ""
  self.icon_order = tonumber(row:getValue("icon_order")) or 0
  self.entry_type = tonumber(row:getValue("entry_type")) or 0
  self.para1 = row:getValue("para1") or ""
  self.para2 = row:getValue("para2") or ""
  self.unlock_lv = tonumber(row:getValue("unlock_lv")) or 0
  self.show_icon = tonumber(row:getValue("show_icon")) or 0
  self.onoff = tonumber(row:getValue("onoff")) or 0
  self.login_open_forbid = tonumber(row:getValue("login_open_forbid")) or 0
  self.banner_bg_new = row:getValue("banner_bg_new") or ""
  self.banner_pic_new = row:getValue("banner_pic_new") or {}
  if CommonUtil.IsJapanABTest() then
    if not string.IsNullOrEmpty(row:getValue("image1_B")) then
      self.image1 = row:getValue("image1_B")
    end
    if not string.IsNullOrEmpty(row:getValue("icon_B")) then
      self.icon = row:getValue("icon_B")
    end
    if not string.IsNullOrEmpty(row:getValue("banner_B")) then
      self.banner = row:getValue("banner_B")
    end
    local banner_pic_new_B = row:getValue("banner_pic_new_B")
    if banner_pic_new_B ~= "" and not table.IsNullOrEmpty(banner_pic_new_B) then
      self.banner_pic_new = row:getValue("banner_pic_new_B")
    end
  end
  self.banner_pic_init_size = row:getValue("banner_pic_init_size") or {}
  self.bg_pic_init_size = row:getValue("bg_pic_init_size") or {}
  self.board_color = tonumber(row:getValue("board_color")) or 0
  self.column_type = tonumber(row:getValue("column_type")) or 0
  self.bg_effect_name = row:getValue("bg_effect_name") or ""
  self.for_effect_name = row:getValue("for_effect_name") or ""
  self.icon_ani = row:getValue("icon_ani") or ""
  local resource_config1 = row:getValue("resource_config1")
  if not string.IsNullOrEmpty(resource_config1) then
    self.resource_config1_list = string.split(resource_config1, "|")
  end
  local resource_config2 = row:getValue("resource_config2")
  if not string.IsNullOrEmpty(resource_config2) then
    self.resource_config2_list = string.string2array_num(resource_config2, ",", "|")
  end
  self.showTimes = row:getValue("showTimes")
end

return RechargeTemplate
