local this = class("pageTestMountSelect", G_UIPageBase)

function this.bind()
  return {
    scrollScene = {
      moduleName = "pages/bugWorld/cellItem/cellTestClickItem"
    }
  }
end

function this.methods()
  return {
    onClick_close = function(self)
      L_UI:close(self.pageName)
    end,
    scrollScene = {
      onClick = function(self, bind)
        L_UI:close(self.pageName)
        AzurWorld.playerMgr.myPlayerUnitAdapter.mountId = bind.id
        AzurWorld.playerMgr.myPlayerUnitAdapter:SwitchToMountMainControl()
      end
    }
  }
end

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

function this:open(options)
  this.super.open(self, options)
  self:refreshSceneList()
end

function this:refreshSceneList()
  local mountList = {}
  self.bind.scrollScene:clear()
  table.merge(mountList, L_GameTpl:getMountTpl().data)
  for _, v in pairs(mountList) do
    self.bind.scrollScene:insert({
      id = v.id,
      txt_name = L_GameTpl:getMountTpl():getNameByTpl(v)
    })
  end
end

function this:close(options)
  this.super.close(self, options)
end

return this
