aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/hydrorollcore/rule.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrorollcore/rule.py')
-rw-r--r--src/hydrorollcore/rule.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/hydrorollcore/rule.py b/src/hydrorollcore/rule.py
index eb4b92cd..a1b07cb9 100644
--- a/src/hydrorollcore/rule.py
+++ b/src/hydrorollcore/rule.py
@@ -14,16 +14,15 @@ class RuleLoadType(Enum):
class Rule(metaclass=ABCMeta):
+ """规则基类"""
+
+ name: str
+ priority: int = 0
+
@abstractmethod
def __init__(self):
- pass
-
- @classmethod
- def __subclasshook__(cls, other):
- if cls is Rule:
- return hasattr(other, "run") and callable(getattr(other, "run"))
- return NotImplemented
+ raise NotImplementedError
@abstractmethod
async def run(self):
- pass
+ raise NotImplementedError