diff options
| -rw-r--r-- | .vscode/settings.json | 5 | ||||
| -rw-r--r-- | docs/_static/.$Structures.svg.dtmp | 4 | ||||
| -rw-r--r-- | docs/_static/hrc_code.png | bin | 0 -> 1016554 bytes | |||
| -rw-r--r-- | examples/rules/BRP/__init__.py | 6 | ||||
| -rw-r--r-- | examples/rules/COC/Character.py (renamed from examples/rules/COC7/Character.py) | 0 | ||||
| -rw-r--r-- | examples/rules/COC/Command.py (renamed from examples/rules/COC7/Command.py) | 0 | ||||
| -rw-r--r-- | examples/rules/COC/Wiki.py (renamed from examples/rules/COC7/Wiki.py) | 0 | ||||
| -rw-r--r-- | examples/rules/COC/__init__.py (renamed from examples/rules/COC7/__init__.py) | 10 | ||||
| -rw-r--r-- | hrc/rule/__init__.py | 6 | ||||
| -rw-r--r-- | src/dev/mod.rs | 0 | ||||
| -rw-r--r-- | src/doc/mod.rs | 0 | ||||
| -rw-r--r-- | src/feat/mod.rs | 0 | ||||
| -rw-r--r-- | src/lib.rs | 13 | ||||
| -rw-r--r-- | src/perf/mod.rs | 1 |
14 files changed, 37 insertions, 8 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 414a2fa..355946f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "restructuredtext.preview.name": "sphinx", "iis.configDir": "", - "livePreview.defaultPreviewPath": "/docs/_build/html/index.html" + "livePreview.defaultPreviewPath": "/docs/_build/html/index.html", + "Lua.diagnostics.disable": [ + "doc-field-no-class" + ] }
\ No newline at end of file diff --git a/docs/_static/.$Structures.svg.dtmp b/docs/_static/.$Structures.svg.dtmp new file mode 100644 index 0000000..acace65 --- /dev/null +++ b/docs/_static/.$Structures.svg.dtmp @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file with editors other than draw.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1px" height="1px" viewBox="-0.5 -0.5 1 1" content="<mxfile host="Electron" modified="2024-07-09T00:44:12.773Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.6.1 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" etag="tdeie8-FcdftL1S-8IuH" version="24.6.1" type="device" pages="2"> <diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1"> <mxGraphModel dx="1036" dy="635" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0" /> <mxCell id="1" parent="0" /> </root> </mxGraphModel> </diagram> <diagram name="Page-1 的副本" id="QUBPRxTMLXw4AuhHwJvm"> <mxGraphModel dx="840" dy="519" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="tazqR-jlQMPDV_MZ-rYC-1" parent="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="VPFQTBCB0J-yRa51enEa-0" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="tazqR-jlQMPDV_MZ-rYC-1"> <mxGeometry x="60" y="560" width="650" height="400" as="geometry" /> </mxCell> <mxCell id="VPFQTBCB0J-yRa51enEa-3" value="" style="shape=internalStorage;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="tazqR-jlQMPDV_MZ-rYC-1"> <mxGeometry x="80" y="580" width="80" height="80" as="geometry" /> </mxCell> </root> </mxGraphModel> </diagram> </mxfile> "><defs/><g><g data-cell-id="0"><g data-cell-id="1"/></g></g></svg>
\ No newline at end of file diff --git a/docs/_static/hrc_code.png b/docs/_static/hrc_code.png Binary files differnew file mode 100644 index 0000000..50c5139 --- /dev/null +++ b/docs/_static/hrc_code.png diff --git a/examples/rules/BRP/__init__.py b/examples/rules/BRP/__init__.py deleted file mode 100644 index 54f2261..0000000 --- a/examples/rules/BRP/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from hrc.rule import Rule - -class BRP(Rule): - async def handle(self) -> None: ... - - async def rule(self) -> bool: return False
\ No newline at end of file diff --git a/examples/rules/COC7/Character.py b/examples/rules/COC/Character.py index bb30661..bb30661 100644 --- a/examples/rules/COC7/Character.py +++ b/examples/rules/COC/Character.py diff --git a/examples/rules/COC7/Command.py b/examples/rules/COC/Command.py index 9819841..9819841 100644 --- a/examples/rules/COC7/Command.py +++ b/examples/rules/COC/Command.py diff --git a/examples/rules/COC7/Wiki.py b/examples/rules/COC/Wiki.py index b97f717..b97f717 100644 --- a/examples/rules/COC7/Wiki.py +++ b/examples/rules/COC/Wiki.py diff --git a/examples/rules/COC7/__init__.py b/examples/rules/COC/__init__.py index 65f40ab..260bfb5 100644 --- a/examples/rules/COC7/__init__.py +++ b/examples/rules/COC/__init__.py @@ -17,6 +17,10 @@ class COC7(Rule): attr: Attributes = Depends() # CharacterCard.Attribute wiki: Wiki = Depends() # Wiki cmd: Command = Depends() # Command # noqa: F821 + + async def handle(self): ... + + async def rule(self): ... @core.event_postprocessor_hook async def auto_card(self): @@ -50,3 +54,9 @@ class COC7(Rule): + " DEX" + str(self.pc.get("DEX", "?")) ) + + +class COC6(Rule): + async def handle(self): ... + + async def rule(self): ... diff --git a/hrc/rule/__init__.py b/hrc/rule/__init__.py index ecced24..4b3d259 100644 --- a/hrc/rule/__init__.py +++ b/hrc/rule/__init__.py @@ -154,6 +154,12 @@ class Rule(ABC, Generic[EventT, StateT, ConfigT]): It is not recommended to implement event processing directly in this method. Please leave the specific processing of events to the ``handle()`` method. """ raise NotImplementedError + + @staticmethod + async def enable(): ... + + @staticmethod + async def disable(): ... @staticmethod def aliases(names, ignore_case=False): diff --git a/src/dev/mod.rs b/src/dev/mod.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/dev/mod.rs diff --git a/src/doc/mod.rs b/src/doc/mod.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/doc/mod.rs diff --git a/src/feat/mod.rs b/src/feat/mod.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/feat/mod.rs @@ -1,6 +1,16 @@ use pyo3::prelude::*; use pyo3::wrap_pyfunction; +use dev::*; +use doc::*; +use feat::*; +use perf::*; + +pub mod dev; +pub mod doc; +pub mod feat; +pub mod perf; + #[pyfunction] fn process_rule_pack(rule_pack: &str) -> PyResult<String> { // 处理规则包的逻辑 @@ -12,5 +22,6 @@ fn process_rule_pack(rule_pack: &str) -> PyResult<String> { #[pyo3(name = "LibCore")] fn libcore(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(process_rule_pack, m)?)?; + perf::Asparagus; Ok(()) -}
\ No newline at end of file +} diff --git a/src/perf/mod.rs b/src/perf/mod.rs new file mode 100644 index 0000000..0444a3a --- /dev/null +++ b/src/perf/mod.rs @@ -0,0 +1 @@ +pub struct Asparagus {}
\ No newline at end of file |
