aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/hrc
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-06-26 09:20:15 +0800
committer简律纯 <i@jyunko.cn>2024-06-26 09:20:15 +0800
commitdcadac73813291a86a4ab3aca44706fc9b8e3b5e (patch)
tree44aaffb958b1375c0124f93fe8079205e9453b85 /hrc
parenta2477b28057251c4685dbf0b56359dee7b595bfa (diff)
downloadHydroRollCore-dcadac73813291a86a4ab3aca44706fc9b8e3b5e.tar.gz
HydroRollCore-dcadac73813291a86a4ab3aca44706fc9b8e3b5e.zip
chore(docs): add structures.svg and contributing guidance
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