update: 'react' method in ActionFlow
This commit is contained in:
@@ -30,13 +30,11 @@ class ActionFlow:
|
|||||||
if self.on[index] is None: raise NotAllowed(name)
|
if self.on[index] is None: raise NotAllowed(name)
|
||||||
self.on[index] = bool(self.actions[index].prepare())
|
self.on[index] = bool(self.actions[index].prepare())
|
||||||
|
|
||||||
def stage(self, *actions: type[Action]):
|
def react(self, *stage: type[Action]):
|
||||||
for Actor in actions:
|
for Props in stage:
|
||||||
self.allow(Actor)
|
self.allow(Props)
|
||||||
self.queue(Actor)
|
self.queue(Props)
|
||||||
self.react()
|
|
||||||
|
|
||||||
def react(self):
|
|
||||||
while any(self.on):
|
while any(self.on):
|
||||||
for index in self.indices.values():
|
for index in self.indices.values():
|
||||||
if (self.on[index]):
|
if (self.on[index]):
|
||||||
|
|||||||
Reference in New Issue
Block a user