fix: added 'deter' function

This commit is contained in:
2026-07-10 17:34:31 +08:00
parent 59c770ba3e
commit 7d2af10043
+9 -3
View File
@@ -56,9 +56,15 @@ class ActionFlow:
assert index is not None, "Action '%s' is not registered" % name
return index
def allow(self, action: type[Action], value=True):
index = self.index(action)
self.on[index] = False if value else None
def allow(self, *actions: type[Action]):
for Item in actions:
index = self.index(Item)
self.on[index] = False
def deter(self, *actions: type[Action]):
for Item in actions:
index = self.index(Item)
self.on[index] = None
def stage(self, *preset: type[Action]):
for Props in preset: