UIDojoBattleCtr.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. local UIDojoBattleCtr = class("UIDojoBattleCtr", require("UICtrBase"))
  2. function UIDojoBattleCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIDojoBattleCtr:SetData(data)
  6. self.asyncIdx = 0
  7. if data == nil then return end
  8. self.data = data
  9. end
  10. function UIDojoBattleCtr:GetAsyncIdx()
  11. self.asyncIdx = self.asyncIdx + 1
  12. return self.asyncIdx
  13. end
  14. function UIDojoBattleCtr:GetData()
  15. return self.data
  16. end
  17. function UIDojoBattleCtr:OnDispose()
  18. self.data = nil
  19. self.view = nil
  20. end
  21. function UIDojoBattleCtr:GetBattleMode()
  22. if self.data and self.data[1] then
  23. return self.data[1]
  24. end
  25. return BattleMode.None
  26. end
  27. function UIDojoBattleCtr:GetBattleSubMode()
  28. if self.data and self.data[2] then
  29. return self.data[2]
  30. end
  31. return BattleSubMode.None
  32. end
  33. function UIDojoBattleCtr:GetMatchFighterName()
  34. if self.data and self.data[3] then
  35. return self.data[3]
  36. end
  37. return ''
  38. end
  39. function UIDojoBattleCtr:GetOurMembers()
  40. if self.data and self.data[4] then
  41. return self.data[4]
  42. end
  43. return {}
  44. end
  45. function UIDojoBattleCtr:GetEnemyMembers()
  46. if self.data and self.data[5] then
  47. return self.data[5]
  48. end
  49. return {}
  50. end
  51. function UIDojoBattleCtr:GetIsLeftTime()
  52. if self.data and self.data[6] then
  53. return self.data[6]
  54. end
  55. return false
  56. end
  57. function UIDojoBattleCtr:GetTotalTime()
  58. if self.data and self.data[7] then
  59. return self.data[7]
  60. end
  61. return 0
  62. end
  63. return UIDojoBattleCtr