From dcadac73813291a86a4ab3aca44706fc9b8e3b5e Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 26 Jun 2024 09:20:15 +0800 Subject: chore(docs): add structures.svg and contributing guidance --- hrc/rules/BaseRule/CharacterCard.py | 22 ++++++++++++++++++++++ hrc/rules/BaseRule/__init__.py | 13 +------------ hrc/rules/__init__.py | 12 +++++++++++- hrc/rules/py.typed | 0 4 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 hrc/rules/BaseRule/CharacterCard.py create mode 100644 hrc/rules/py.typed (limited to 'hrc/rules') 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/rules/py.typed b/hrc/rules/py.typed new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2