Action: Don't need the owner in the constructor. Factory function to create a child.
[python-bulletml.git] / bulletml / parser.py
index 2075ac9..c8bc990 100644 (file)
@@ -368,8 +368,7 @@ class Repeat(object):
     def __call__(self, owner, action, params, rank, created):
         repeat = self.times(params, rank)
         actions, params = self.action(params, rank)
-        child = action.__class__(
-            owner, action, actions, params, rank, repeat)
+        child = action.Child(actions, params, rank, repeat)
         owner.replace(action, child)
         child.step(owner, created)
         return True
@@ -424,7 +423,7 @@ class If(object):
 
         if branch:
             actions, params = branch(params, rank)
-            child = action.__class__(owner, action, actions, params, rank)
+            child = action.Child(actions, params, rank)
             owner.replace(action, child)
             child.step(owner, created)
             return True