aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/hydrorollcore/rule.py
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-12-08 01:03:07 +0800
committerGitHub <noreply@github.com>2023-12-08 01:03:07 +0800
commite777e9261caf84be00a218b60045a14741beee7b (patch)
tree2b0ee095438f929a27fd0af42e40554c6e1ce45d /src/hydrorollcore/rule.py
parentc10c8237470b5edb6a383e557324fab06fc8d855 (diff)
parentd3076462c53afc848622052611a2ed7c241434e9 (diff)
downloadinfini-e777e9261caf84be00a218b60045a14741beee7b.tar.gz
infini-e777e9261caf84be00a218b60045a14741beee7b.zip
Merge pull request #32 from fu050409/master
🎨 优化抽象基类
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