UIGuildHuntLogCtr.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. local UIGuildHuntLogCtr = class("UIGuildHuntLogCtr", require("UICtrBase"))
  2. function UIGuildHuntLogCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIGuildHuntLogCtr:SetData(data)
  6. self.asyncIdx = 0
  7. self.data = data
  8. self:InitData()
  9. end
  10. function UIGuildHuntLogCtr:GetAsyncIdx()
  11. self.asyncIdx = self.asyncIdx + 1
  12. return self.asyncIdx
  13. end
  14. function UIGuildHuntLogCtr:GetData()
  15. return self.data
  16. end
  17. function UIGuildHuntLogCtr:OnDispose()
  18. -- if self.guildData then
  19. -- self.guildData:ClearHuntBossLogs(self.data)
  20. -- end
  21. self.guildData = nil
  22. self.data = nil
  23. self.view = nil
  24. end
  25. function UIGuildHuntLogCtr:InitData()
  26. self.guildData = ManagerContainer.DataMgr.GuildDataMgr:GetCurGuildData()
  27. end
  28. function UIGuildHuntLogCtr:GetBossId()
  29. return self.data
  30. end
  31. function UIGuildHuntLogCtr:GetLogWhole()
  32. return self.guildData:GetHuntBossLogWhole(self:GetBossId())
  33. end
  34. function UIGuildHuntLogCtr:GetLogNum()
  35. return self.guildData:GetHuntBossLogNum(self:GetBossId())
  36. end
  37. function UIGuildHuntLogCtr:GetLogMaxNum()
  38. return 50
  39. end
  40. function UIGuildHuntLogCtr:GetLogById(idx)
  41. return self.guildData:GetHuntBossLogById(self:GetBossId(), idx + 1)
  42. end
  43. function UIGuildHuntLogCtr:GetReloadLogStartTime()
  44. return self.guildData:GetReloadHuntBossLogStartTime(self:GetBossId())
  45. end
  46. function UIGuildHuntLogCtr:GetNextLoadLogStartTime()
  47. return self.guildData:GetNextLoadHuntBossLogStartTime(self:GetBossId())
  48. end
  49. function UIGuildHuntLogCtr:SendGuildHuntBossLogReq(isBegin)
  50. local errorCode = 0
  51. if isBegin then
  52. local time = self:GetReloadLogStartTime()
  53. if not time then
  54. return 1
  55. end
  56. if not ManagerContainer.DataMgr.GuildDataMgr:SendGuildHuntBossLogReq(self:GetBossId(), time) then
  57. return 100007
  58. end
  59. else
  60. if self:GetLogWhole() then
  61. return 1
  62. end
  63. local time = self:GetNextLoadLogStartTime()
  64. if not time then
  65. return 1
  66. end
  67. if not ManagerContainer.DataMgr.GuildDataMgr:SendGuildHuntBossLogReq(self:GetBossId(), time) then
  68. return 100007
  69. end
  70. end
  71. return errorCode
  72. end
  73. return UIGuildHuntLogCtr