local this = {}

function this:checkIsDisableInteractTransfer(csEntity)
  if csEntity ~= nil and csEntity.worldData ~= nil then
    local taskId = C_TaskManager.CheckTaskDisableInteractTransfer(csEntity.worldData.worlworldMapIddGuid, csEntity.worldData.worldType)
    if taskId ~= 0 then
      self:_showDisableTransferMsg(taskId)
      return true
    end
  end
  return false
end

function this:checkIsDisableMapTransfer()
  local taskId = C_TaskManager.CheckTaskDisableMapTransfer()
  if taskId ~= 0 then
    self:_showDisableTransferMsg(taskId)
    return true
  end
  if L_PlayerManager:inKiBoTransformMainControl() then
    L_FlyMsgManager:showNormalMsg(L_WordsTpl:getValue("notice_transform_06"))
    return true
  end
  return false
end

function this:_showDisableTransferMsg(taskId)
  local taskTpl = L_GameTpl:getTaskTpl()
  local taskData = taskTpl:getTplById(taskId)
  local taskName = taskData ~= nil and taskTpl:getName(taskData) or ""
  L_FlyMsgManager:showNormalMsgByKey("notice_task_disabletransfer", {
    [0] = taskName
  })
end

function this:checkIsDisableSystem(systemId, noTip)
  if AzurWorld.FeatureControlMgr:CheckFunctionDisable(systemId) then
    if not noTip then
      local _systemTpl = L_GameTpl:getSystemUnlockTpl()
      local tpl = _systemTpl:getTplById(systemId)
      local name = tpl ~= nil and _systemTpl:getName(tpl) or tostring(systemId)
      L_FlyMsgManager:showNormalMsgByKey("notice_task_disablesystemfunction", {
        [0] = name
      })
    end
    return true
  end
  return false
end

return this
