GMNoticeData.lua 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. local GMNoticeData = class("GMNoticeData", require("DataBase"))
  2. local ProtocalDataNormal = require("ProtocalDataNormal")
  3. function GMNoticeData:ctor()
  4. self.data = {}
  5. end
  6. function GMNoticeData:AddNewNotice(data)
  7. self.data.curNotice = ProtocalDataNormal.ParseGMNoticeData(data)
  8. ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.GM_SCROLL_NOTICE)
  9. end
  10. function GMNoticeData:NilCurNotice()
  11. self.data.curNotice = nil
  12. end
  13. function GMNoticeData:GetCurNotice()
  14. return self.data.curNotice
  15. end
  16. function GMNoticeData:RegisterNetEvents()
  17. ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_WEB_GM_NOTICE_NTF, function(data)
  18. self:AddNewNotice(data.notice_info)
  19. end)
  20. end
  21. function GMNoticeData:Save()
  22. end
  23. function GMNoticeData:Clear()
  24. self.data = {}
  25. end
  26. function GMNoticeData:Destroy()
  27. if self.Clear then
  28. self:Clear()
  29. end
  30. self:UnRegisterNetEvents()
  31. end
  32. function GMNoticeData:UnRegisterNetEvents()
  33. end
  34. return GMNoticeData