update: 'react' method in ActionFlow

This commit is contained in:
2026-06-05 09:43:30 +08:00
parent 101058b20c
commit 1b9aff9676
+4 -6
View File
@@ -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]):