UICollectCtr.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. local UICollectCtr = class("UICollectCtr", require("UICtrBase"))
  2. function UICollectCtr:Init(view)
  3. self.view = view
  4. end
  5. function UICollectCtr:SetData(data)
  6. self.asyncIdx = 0
  7. if data == nil then return end
  8. self.data = data
  9. end
  10. function UICollectCtr:GetAsyncIdx()
  11. self.asyncIdx = self.asyncIdx + 1
  12. return self.asyncIdx
  13. end
  14. function UICollectCtr:GetData()
  15. return self.data
  16. end
  17. function UICollectCtr:SetCardBookCtr(ctr)
  18. self.cardBookCtr = ctr
  19. end
  20. function UICollectCtr:GetCardBookOffsetCfgId(curCfgId, offset)
  21. if self.cardBookCtr and self.cardBookCtr.GetCardBookOffsetCfgId then
  22. return self.cardBookCtr:GetCardBookOffsetCfgId(curCfgId, offset)
  23. end
  24. return curCfgId
  25. end
  26. function UICollectCtr:GetPetBookOffsetCfgId(curCfgId, offset)
  27. if self.petBookCtr and self.petBookCtr.GetPetBookOffsetCfgId then
  28. return self.petBookCtr:GetPetBookOffsetCfgId(curCfgId, offset)
  29. end
  30. return curCfgId
  31. end
  32. function UICollectCtr:SetPetBookCtr(ctr)
  33. self.petBookCtr = ctr
  34. end
  35. function UICollectCtr:SetKeepSakeBookCtr(ctr)
  36. self.keepSakeBookCtr = ctr
  37. end
  38. function UICollectCtr:GetKeepSakeBookOffsetCfgId(curCfgId, offset)
  39. if self.keepSakeBookCtr and self.keepSakeBookCtr.GetKeepSakeBookOffsetCfgId then
  40. return self.keepSakeBookCtr:GetKeepSakeBookOffsetCfgId(curCfgId, offset)
  41. end
  42. return curCfgId
  43. end
  44. function UICollectCtr:OnDispose()
  45. self.cardBookCtr = nil
  46. self.petBookCtr = nil
  47. self.keepSakeBookCtr = nil
  48. self.data = nil
  49. self.view = nil
  50. end
  51. return UICollectCtr