rxevent.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # rxevent.py
  2. #print "rxevent.................................."
  3. class RexEvent(object):
  4. MyName = ""
  5. #def __init__(self):
  6. # super(self.__class__,self).__init__()
  7. #def __del__(self):
  8. # pass
  9. def PrintDebugStr(self):
  10. pass
  11. # Touch
  12. class RexEventTouchStart(RexEvent):
  13. MyName = "touch_start"
  14. def __init__(self, *args):
  15. super(self.__class__,self).__init__()
  16. self.ObjectId = str(args[0])
  17. self.AgentId = str(args[1])
  18. def PrintDebugStr(self):
  19. print self.MyName,self.ObjectId,self.AgentId
  20. # Timer
  21. class RexEventTimer(RexEvent):
  22. MyName = "timer"
  23. def __init__(self, vObjId,vTime,vbLoop):
  24. super(self.__class__,self).__init__()
  25. self.ObjectId = str(vObjId)
  26. self.TTime = vTime
  27. self.bLoop = vbLoop
  28. def PrintDebugStr(self):
  29. print self.MyName,self.ObjectId,self.TTime,self.bLoop
  30. # SetTimer
  31. class RexEventSetTimer(RexEvent):
  32. MyName = "set_timer"
  33. def __init__(self, vObjId,vTime,vbLoop):
  34. super(self.__class__,self).__init__()
  35. self.ObjectId = str(vObjId)
  36. self.TTime = vTime
  37. self.bLoop = vbLoop
  38. def PrintDebugStr(self):
  39. print self.MyName,self.ObjectId,self.TTime,self.bLoop
  40. # SetTick
  41. class RexEventSetTick(RexEvent):
  42. MyName = "set_tick"
  43. def __init__(self, vObjId,vbTick):
  44. super(self.__class__,self).__init__()
  45. self.ObjectId = str(vObjId)
  46. self.bTick = vbTick
  47. def PrintDebugStr(self):
  48. print self.MyName,self.ObjectId,self.bTick
  49. # Add entity
  50. class RexEventAddEntity(RexEvent):
  51. MyName = "add_entity"
  52. def __init__(self,*args):
  53. super(self.__class__,self).__init__()
  54. self.ObjectId = str(args[0])
  55. def PrintDebugStr(self):
  56. print self.MyName,self.ObjectId
  57. # Remove entity
  58. class RexEventRemoveEntity(RexEvent):
  59. MyName = "remove_entity"
  60. def __init__(self,*args):
  61. super(self.__class__,self).__init__()
  62. self.ObjectId = str(args[0])
  63. def PrintDebugStr(self):
  64. print self.MyName,self.ObjectId
  65. # Add presence
  66. class RexEventAddPresence(RexEvent):
  67. MyName = "add_presence"
  68. def __init__(self,*args):
  69. super(self.__class__,self).__init__()
  70. self.ObjectId = str(args[0])
  71. self.AgentId = str(args[1])
  72. def PrintDebugStr(self):
  73. print self.MyName,self.ObjectId,self.AgentId
  74. # Remove presence
  75. class RexEventRemovePresence(RexEvent):
  76. MyName = "remove_presence"
  77. def __init__(self,*args):
  78. super(self.__class__,self).__init__()
  79. self.AgentId = str(args[0])
  80. def PrintDebugStr(self):
  81. print self.MyName,self.AgentId
  82. # Client event
  83. class RexEventClientEvent(RexEvent):
  84. MyName = "client_event"
  85. def __init__(self,*args):
  86. super(self.__class__,self).__init__()
  87. self.AgentId = str(args[0])
  88. self.Params = args
  89. def PrintDebugStr(self):
  90. print self.MyName,self.AgentId
  91. # PrimVolumeCollision event
  92. class RexEventPrimVolumeCollision(RexEvent):
  93. MyName = "primvol_col"
  94. def __init__(self,*args):
  95. super(self.__class__,self).__init__()
  96. self.ObjectId = str(args[0])
  97. self.ColliderId = str(args[1])
  98. def PrintDebugStr(self):
  99. print self.MyName,self.ObjectId,self.ColliderId