aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/hrc
diff options
context:
space:
mode:
Diffstat (limited to 'hrc')
-rw-r--r--hrc/__init__.py2
-rw-r--r--hrc/rules/BaseRule/CharacterCard.py22
-rw-r--r--hrc/rules/BaseRule/__init__.py13
-rw-r--r--hrc/rules/__init__.py12
-rw-r--r--hrc/rules/py.typed (renamed from hrc/rule_package.py)0
-rw-r--r--hrc/typing.py7
6 files changed, 43 insertions, 13 deletions
diff --git a/hrc/__init__.py b/hrc/__init__.py
index 6c6b22c..b8a3bde 100644
--- a/hrc/__init__.py
+++ b/hrc/__init__.py
@@ -1,2 +1,4 @@
from .LibCore import *
+
from . import rules
+# from . import \ No newline at end of file
diff --git a/hrc/rules/BaseRule/CharacterCard.py b/hrc/rules/BaseRule/CharacterCard.py
new file mode 100644
index 0000000..6d09e5a
--- /dev/null
+++ b/hrc/rules/BaseRule/CharacterCard.py
@@ -0,0 +1,22 @@
+import dataclasses
+from dataclasses import dataclass
+from typing import Literal, Optional, Union
+
+
+@dataclass
+class Custom(object):
+ """Docstring for Custom."""
+ property: type
+
+
+class Attribute(Custom):
+ ...
+
+
+class Skill(Custom):
+ ...
+
+
+class Information(Custom):
+ ...
+
diff --git a/hrc/rules/BaseRule/__init__.py b/hrc/rules/BaseRule/__init__.py
index 4d3bc9d..c30e24a 100644
--- a/hrc/rules/BaseRule/__init__.py
+++ b/hrc/rules/BaseRule/__init__.py
@@ -3,18 +3,7 @@ from dataclasses import dataclass
from typing import Literal, Optional, Union
from . import JudgeRule
-
-@dataclass
-class CharacterCard(object):
- """Docstring for CharacterCard."""
- property: type
-
- class Information(object):
- age: Optional[Union[int, str]]
- race: Optional[str]
- gender: Optional[str]
- group: Optional[str]
-
+from . import CharacterCard
@dataclass
class CustomRule(object):
diff --git a/hrc/rules/__init__.py b/hrc/rules/__init__.py
index be96d47..ccd3dbc 100644
--- a/hrc/rules/__init__.py
+++ b/hrc/rules/__init__.py
@@ -1 +1,11 @@
-from . import BaseRule \ No newline at end of file
+from typing import Generic, Any, Type
+
+from abc import ABC
+
+from . import BaseRule
+from ..typing import RulesT
+
+
+class Rules(ABC, Generic[RulesT]):
+ ...
+ \ No newline at end of file
diff --git a/hrc/rule_package.py b/hrc/rules/py.typed
index e69de29..e69de29 100644
--- a/hrc/rule_package.py
+++ b/hrc/rules/py.typed
diff --git a/hrc/typing.py b/hrc/typing.py
index e69de29..b3ced30 100644
--- a/hrc/typing.py
+++ b/hrc/typing.py
@@ -0,0 +1,7 @@
+from typing import TypeVar, Generic, Any, TYPE_CHECKING, Awaitable, Callable, Optional
+
+if TYPE_CHECKING:
+ from .rules import Rules
+
+
+RulesT = TypeVar("RulesT", bound="Rules[Any]") \ No newline at end of file