local NpcQABubbleManager = BaseClass("NpcQABubbleManager")
local UINpcQABubble = require("UI.UINpcQABubble.UINpcQABubble")
local ResourceManager = CS.GameEntry.Resource
local NpcName = "CityNpc_nvzhubo"
local __init = function(self)
  self.bubble = nil
  self.showFlag = true
  self:AddListener()
end
local __delete = function(self)
  self.bubble = nil
  self.showFlag = nil
  self:RemoveQuestionBubble()
  self:RemoveListener()
end
local AddListener = function(self)
  EventManager:GetInstance():AddListener(EventId.NPCQuestBubbleNeedRefresh, self.DoWhenQuestionNeedRefresh)
end
local RemoveListener = function(self)
  EventManager:GetInstance():RemoveListener(EventId.NPCQuestBubbleNeedRefresh, self.DoWhenQuestionNeedRefresh)
end
local StartUp = function(self)
end
local DoWhenQuestionNeedRefresh = function()
end
local AddQuestionBubble = function(self)
  if self.request ~= nil or self.bubble ~= nil then
    return
  end
end
local RemoveQuestionBubble = function(self)
  if self.bubble ~= nil then
    self.bubble:OnDestroy()
    self.bubble = nil
  end
  if self.request ~= nil then
    if self.request.gameObject ~= nil then
      self.request.gameObject:Destroy()
    end
    self.request = nil
  end
end
local SetQuestionBubbleFlag = function(self, flag)
  self.showFlag = flag
  if not self.showFlag then
    self:RemoveQuestionBubble()
    return
  end
end
local IsNpcQABubbleShow = function(self)
  return self.request ~= nil and self.bubble ~= nil
end
NpcQABubbleManager.__init = __init
NpcQABubbleManager.__delete = __delete
NpcQABubbleManager.AddQuestionBubble = AddQuestionBubble
NpcQABubbleManager.RemoveQuestionBubble = RemoveQuestionBubble
NpcQABubbleManager.StartUp = StartUp
NpcQABubbleManager.SetQuestionBubbleFlag = SetQuestionBubbleFlag
NpcQABubbleManager.AddListener = AddListener
NpcQABubbleManager.RemoveListener = RemoveListener
NpcQABubbleManager.DoWhenQuestionNeedRefresh = DoWhenQuestionNeedRefresh
NpcQABubbleManager.IsNpcQABubbleShow = IsNpcQABubbleShow
return NpcQABubbleManager
