فهرست منبع

distributed: Switch DistributedSmoothNodeBase.BroadcastTypes to IntEnum

The Enum from PythonUtil is obsolete since the introduction of a proper enum module in Python 3.4.
rdb 4 سال پیش
والد
کامیت
3579855ff1
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      direct/src/distributed/DistributedSmoothNodeBase.py

+ 9 - 2
direct/src/distributed/DistributedSmoothNodeBase.py

@@ -3,9 +3,12 @@
 from .ClockDelta import *
 from direct.task import Task
 from direct.task.TaskManagerGlobal import taskMgr
-from direct.showbase.PythonUtil import randFloat, Enum
+from direct.showbase.PythonUtil import randFloat
 from panda3d.direct import CDistributedSmoothNodeBase
 
+from enum import IntEnum
+
+
 class DummyTaskClass:
     def setDelay(self, blah):
         pass
@@ -15,7 +18,11 @@ DummyTask = DummyTaskClass()
 class DistributedSmoothNodeBase:
     """common base class for DistributedSmoothNode and DistributedSmoothNodeAI
     """
-    BroadcastTypes = Enum('FULL, XYH, XY')
+
+    class BroadcastTypes(IntEnum):
+        FULL = 0
+        XYH = 1
+        XY = 2
 
     def __init__(self):
         self.__broadcastPeriod = None