local module = class("cellPetGetGene", G_UIModuleBase)
local petDna = L_GameTpl:getDnaTpl()

function module:ctor(...)
  module.super.ctor(self, ...)
  self.data = {
    id = nil,
    guid = nil,
    rarity = {
      [1] = 1,
      [2] = 1,
      [3] = 2,
      [4] = 3,
      [5] = 4,
      [6] = 5
    }
  }
end

function module.bind()
  return {
    normalName = "",
    shiningName = "",
    purpleName = "",
    goldName = "",
    greyName = "",
    rarity_0 = false,
    rarity_1 = false,
    rarity_2 = false,
    rarity_3 = false,
    rarity_4 = false
  }
end

function module.methods()
  return {}
end

function module:refresh()
  self:refreshInfo()
end

function module:refreshInfo()
  self.bind.normalName = self.bind.skillName
  self.bind.shiningName = self.bind.skillName
  self.bind.goldName = self.bind.skillName
  self.bind.purpleName = self.bind.skillName
  self.bind.greyName = self.bind.skillName
  if not math.isEmpty(self.bind.geneId) then
    local geneIndex = self.data.rarity[self.bind.rarity] - 1
    local rarityName = string.format("rarity_%d", geneIndex)
    self.bind[rarityName] = true
  end
end

function module:close()
end

return module
