local this = class("cellAnnouncementType", G_UIModuleBase)

function this.bind()
  return {
    go_active = false,
    go_normal = false,
    isShow = true
  }
end

function this.methods()
  return {
    onClick_select = function(self)
      if self.bind.type == self.parent.selectType then
        self.isSampleType = true
        return
      else
        self.isSampleType = false
      end
      self:emit("onClick_select", self.bind.type)
      if not self.isSampleType then
        self.parent.bindComponents.mainLeftContentAnim:Stop()
        self.parent.bindComponents.mainLeftContentAnim:Play()
        self.parent.bindComponents.mainRightContentAnim:Stop()
        self.parent.bindComponents.mainRightContentAnim:Play()
        L_AudioUtil.playSound("Play_SFX_System_UI_Post_Menu_Type_Click")
        self.parent.parent:resetSelectObj()
      end
    end
  }
end

function this:open()
  if self:checkShowRedDot() then
    L_ReddotManager:registerReddot(self.bindComponents.reddotNew, string.format(L_ReddotManager.DotDef.AnnouncementActive, "Anncouncement_" .. self.bind.type))
  else
    self.bindComponents.reddotNew.gameObject:SetActive(false)
  end
end

function this:checkShowRedDot()
  return self.parent:checkShowRedDot()
end

return this
