local this = class("mapSceneBorderTransferNode", require("ui.manager.map.node.mapNode"))
local _typeTxt = typeof(C_LTextMeshProUGUI)
local _typeRect = typeof(C_RectTransform)
local _worldFilterMarkTpl = L_GameTpl:getWorldFilterMarkTpl()
local PATH = "UI/Pages/Map/BigMap/cellSceneBorderTransfer.prefab"

function this:refreshPosByMapData(mapData)
  this.super.refreshPosByMapData(self, mapData)
end

function this:generate(parent, pool)
  self:_generate(parent, pool or L_ResPool)
  if parent then
    self.trans:Reset(parent)
  else
    L_Vector3.setScale(self.trans, L_Vector3.getTemp(1, 1, 1))
    L_Vector3.setLocalPos(self.trans, L_Vector3.getTemp())
  end
  self.go.name = self.id
  self.isShow = true
  self.txtName.text = self._name
  L_Vector3.setLocalRot(self.rectArrow, L_Vector3.new(0, 0, self._angle))
end

function this:_generate(parent, pool)
  local go = pool:syncGameObject(PATH)
  self.go = go
  self.trans = self.go:GetComponent(_typeRect)
  self.txtName = L_GameUtil.findTranByName(self.go, "txt_name").gameObject:GetComponent(_typeTxt)
  self.rectArrow = L_GameUtil.findTranByName(self.go, "img_arrow").gameObject:GetComponent(_typeRect)
end

function this:setData(filterMarkId)
  local tpl = _worldFilterMarkTpl:getTplById(filterMarkId)
  self._name = _worldFilterMarkTpl:getName(tpl)
  self._angle = _worldFilterMarkTpl:getAngle(tpl)
end

function this:onDestroy()
  this.super.onDestroy(self)
end

return this
