aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-07-15 18:38:53 +0800
committer简律纯 <i@jyunko.cn>2024-07-15 18:38:53 +0800
commitfae8d2273dfad2dd0cf9709f15e24640e7ebfd8d (patch)
treec7e170446bcadfef013bf3290a6c4188053949cc
parent03812119ea6e99f549793a5e7ffac4b5765fa6a3 (diff)
downloadHydroRollCore-fae8d2273dfad2dd0cf9709f15e24640e7ebfd8d.tar.gz
HydroRollCore-fae8d2273dfad2dd0cf9709f15e24640e7ebfd8d.zip
feat(Improve the underlying business directory): Improve the underlying business directory
Add { doc | feat | perf | dev } mods
-rw-r--r--.vscode/settings.json5
-rw-r--r--docs/_static/.$Structures.svg.dtmp4
-rw-r--r--docs/_static/hrc_code.pngbin0 -> 1016554 bytes
-rw-r--r--examples/rules/BRP/__init__.py6
-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__.py6
-rw-r--r--src/dev/mod.rs0
-rw-r--r--src/doc/mod.rs0
-rw-r--r--src/feat/mod.rs0
-rw-r--r--src/lib.rs13
-rw-r--r--src/perf/mod.rs1
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="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2024-07-09T00:44:12.773Z&quot; agent=&quot;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&quot; etag=&quot;tdeie8-FcdftL1S-8IuH&quot; version=&quot;24.6.1&quot; type=&quot;device&quot; pages=&quot;2&quot;&gt;&#10; &lt;diagram id=&quot;prtHgNgQTEPvFCAcTncT&quot; name=&quot;Page-1&quot;&gt;&#10; &lt;mxGraphModel dx=&quot;1036&quot; dy=&quot;635&quot; grid=&quot;1&quot; gridSize=&quot;10&quot; guides=&quot;1&quot; tooltips=&quot;1&quot; connect=&quot;1&quot; arrows=&quot;1&quot; fold=&quot;1&quot; page=&quot;1&quot; pageScale=&quot;1&quot; pageWidth=&quot;827&quot; pageHeight=&quot;1169&quot; math=&quot;0&quot; shadow=&quot;0&quot;&gt;&#10; &lt;root&gt;&#10; &lt;mxCell id=&quot;0&quot; /&gt;&#10; &lt;mxCell id=&quot;1&quot; parent=&quot;0&quot; /&gt;&#10; &lt;/root&gt;&#10; &lt;/mxGraphModel&gt;&#10; &lt;/diagram&gt;&#10; &lt;diagram name=&quot;Page-1 的副本&quot; id=&quot;QUBPRxTMLXw4AuhHwJvm&quot;&gt;&#10; &lt;mxGraphModel dx=&quot;840&quot; dy=&quot;519&quot; grid=&quot;1&quot; gridSize=&quot;10&quot; guides=&quot;1&quot; tooltips=&quot;1&quot; connect=&quot;1&quot; arrows=&quot;1&quot; fold=&quot;1&quot; page=&quot;1&quot; pageScale=&quot;1&quot; pageWidth=&quot;827&quot; pageHeight=&quot;1169&quot; math=&quot;0&quot; shadow=&quot;0&quot;&gt;&#10; &lt;root&gt;&#10; &lt;mxCell id=&quot;tazqR-jlQMPDV_MZ-rYC-0&quot; /&gt;&#10; &lt;mxCell id=&quot;tazqR-jlQMPDV_MZ-rYC-1&quot; parent=&quot;tazqR-jlQMPDV_MZ-rYC-0&quot; /&gt;&#10; &lt;mxCell id=&quot;VPFQTBCB0J-yRa51enEa-0&quot; value=&quot;&quot; style=&quot;rounded=0;whiteSpace=wrap;html=1;&quot; vertex=&quot;1&quot; parent=&quot;tazqR-jlQMPDV_MZ-rYC-1&quot;&gt;&#10; &lt;mxGeometry x=&quot;60&quot; y=&quot;560&quot; width=&quot;650&quot; height=&quot;400&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;mxCell id=&quot;VPFQTBCB0J-yRa51enEa-3&quot; value=&quot;&quot; style=&quot;shape=internalStorage;whiteSpace=wrap;html=1;backgroundOutline=1;&quot; vertex=&quot;1&quot; parent=&quot;tazqR-jlQMPDV_MZ-rYC-1&quot;&gt;&#10; &lt;mxGeometry x=&quot;80&quot; y=&quot;580&quot; width=&quot;80&quot; height=&quot;80&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;/root&gt;&#10; &lt;/mxGraphModel&gt;&#10; &lt;/diagram&gt;&#10;&lt;/mxfile&gt;&#10;"><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
new file mode 100644
index 0000000..50c5139
--- /dev/null
+++ b/docs/_static/hrc_code.png
Binary files differ
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
diff --git a/src/lib.rs b/src/lib.rs
index 1c11a3d..5337470 100644
--- a/src/lib.rs
+++ b/src/lib.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