Skip to content

Commit

Permalink
chore(docs): add structures.svg and contributing guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Jun 26, 2024
1 parent a2477b2 commit dcadac7
Show file tree
Hide file tree
Showing 15 changed files with 132 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"restructuredtext.preview.name": "sphinx",
"iis.configDir": ""
"iis.configDir": "",
"livePreview.defaultPreviewPath": "/docs/_build/html/index.html"
}
8 changes: 8 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONTRIBUTING
============

How to commit with PullRequest?
-------------------------------

How to open an issue?
---------------------
42 changes: 42 additions & 0 deletions docs/_static/.$Structures.svg.bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<mxfile>
<diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1">
<mxGraphModel dx="1223" dy="871" 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" />
<mxCell id="dNxyNK7c78bLwvsdeMH5-11" value="Orgchart" style="swimlane;html=1;startSize=20;horizontal=1;containerType=tree;glass=0;" parent="1" vertex="1">
<mxGeometry x="40" y="80" width="710" height="290" as="geometry" />
</mxCell>
<UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Tessa Miller" position="CFO" location="Office 1" email="[email protected]" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-12">
<mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeMoving=1;treeFolding=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1">
<mxGeometry x="260" y="50" width="180" height="70" as="geometry" />
</mxCell>
</UserObject>
<mxCell id="dNxyNK7c78bLwvsdeMH5-13" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-14" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Edward Morrison" position="Brand Manager" location="Office 2" email="[email protected]" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-14">
<mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1">
<mxGeometry x="40" y="180" width="180" height="80" as="geometry" />
</mxCell>
</UserObject>
<mxCell id="dNxyNK7c78bLwvsdeMH5-15" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-16" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Evan Valet" position="HR Director" location="Office 4" email="[email protected]" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-16">
<mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1">
<mxGeometry x="260" y="180" width="180" height="80" as="geometry" />
</mxCell>
</UserObject>
<mxCell id="dNxyNK7c78bLwvsdeMH5-17" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-18" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Alison Donovan" position="System Admin" location="Office 3" email="[email protected]" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-18">
<mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1">
<mxGeometry x="490" y="180" width="180" height="80" as="geometry" />
</mxCell>
</UserObject>
</root>
</mxGraphModel>
</diagram>
</mxfile>
4 changes: 4 additions & 0 deletions docs/_static/.$Structures.svg.dtmp
Original file line number Diff line number Diff line change
@@ -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="571px" height="301px" viewBox="-0.5 -0.5 571 301" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2024-06-26T01:01:45.575Z&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; version=&quot;24.6.1&quot; etag=&quot;pZS_4PXEmtHSB9fLTIs3&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;1877&quot; dy=&quot;649&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;mxCell id=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; value=&quot;Orgchart&quot; style=&quot;swimlane;html=1;startSize=20;horizontal=1;containerType=tree;glass=0;&quot; parent=&quot;1&quot; vertex=&quot;1&quot;&gt;&#10; &lt;mxGeometry x=&quot;-40&quot; y=&quot;150&quot; width=&quot;710&quot; height=&quot;290&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;UserObject label=&quot;%name%&amp;lt;br&amp;gt;&amp;lt;i style=&amp;quot;color: gray&amp;quot;&amp;gt;%position%&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&amp;quot;mailto:%email%&amp;quot;&amp;gt;Email&amp;lt;/a&amp;gt;&quot; name=&quot;Tessa Miller&quot; position=&quot;CFO&quot; location=&quot;Office 1&quot; email=&quot;[email protected]&quot; placeholders=&quot;1&quot; link=&quot;https://www.draw.io&quot; id=&quot;dNxyNK7c78bLwvsdeMH5-12&quot;&gt;&#10; &lt;mxCell style=&quot;label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeMoving=1;treeFolding=1;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; vertex=&quot;1&quot;&gt;&#10; &lt;mxGeometry x=&quot;260&quot; y=&quot;50&quot; width=&quot;180&quot; height=&quot;70&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;/UserObject&gt;&#10; &lt;mxCell id=&quot;dNxyNK7c78bLwvsdeMH5-13&quot; value=&quot;&quot; style=&quot;endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; source=&quot;dNxyNK7c78bLwvsdeMH5-12&quot; target=&quot;dNxyNK7c78bLwvsdeMH5-14&quot; edge=&quot;1&quot;&gt;&#10; &lt;mxGeometry relative=&quot;1&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;UserObject label=&quot;%name%&amp;lt;br&amp;gt;&amp;lt;i style=&amp;quot;color: gray&amp;quot;&amp;gt;%position%&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&amp;quot;mailto:%email%&amp;quot;&amp;gt;Email&amp;lt;/a&amp;gt;&quot; name=&quot;Edward Morrison&quot; position=&quot;Brand Manager&quot; location=&quot;Office 2&quot; email=&quot;[email protected]&quot; placeholders=&quot;1&quot; link=&quot;https://www.draw.io&quot; id=&quot;dNxyNK7c78bLwvsdeMH5-14&quot;&gt;&#10; &lt;mxCell style=&quot;label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; vertex=&quot;1&quot;&gt;&#10; &lt;mxGeometry x=&quot;40&quot; y=&quot;180&quot; width=&quot;180&quot; height=&quot;80&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;/UserObject&gt;&#10; &lt;mxCell id=&quot;dNxyNK7c78bLwvsdeMH5-15&quot; value=&quot;&quot; style=&quot;endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; source=&quot;dNxyNK7c78bLwvsdeMH5-12&quot; target=&quot;dNxyNK7c78bLwvsdeMH5-16&quot; edge=&quot;1&quot;&gt;&#10; &lt;mxGeometry relative=&quot;1&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;UserObject label=&quot;%name%&amp;lt;br&amp;gt;&amp;lt;i style=&amp;quot;color: gray&amp;quot;&amp;gt;%position%&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&amp;quot;mailto:%email%&amp;quot;&amp;gt;Email&amp;lt;/a&amp;gt;&quot; name=&quot;Evan Valet&quot; position=&quot;HR Director&quot; location=&quot;Office 4&quot; email=&quot;[email protected]&quot; placeholders=&quot;1&quot; link=&quot;https://www.draw.io&quot; id=&quot;dNxyNK7c78bLwvsdeMH5-16&quot;&gt;&#10; &lt;mxCell style=&quot;label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; vertex=&quot;1&quot;&gt;&#10; &lt;mxGeometry x=&quot;260&quot; y=&quot;180&quot; width=&quot;180&quot; height=&quot;80&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;/UserObject&gt;&#10; &lt;mxCell id=&quot;dNxyNK7c78bLwvsdeMH5-17&quot; value=&quot;&quot; style=&quot;endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; source=&quot;dNxyNK7c78bLwvsdeMH5-12&quot; target=&quot;dNxyNK7c78bLwvsdeMH5-18&quot; edge=&quot;1&quot;&gt;&#10; &lt;mxGeometry relative=&quot;1&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;UserObject label=&quot;%name%&amp;lt;br&amp;gt;&amp;lt;i style=&amp;quot;color: gray&amp;quot;&amp;gt;%position%&amp;lt;/i&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&amp;quot;mailto:%email%&amp;quot;&amp;gt;Email&amp;lt;/a&amp;gt;&quot; name=&quot;Alison Donovan&quot; position=&quot;System Admin&quot; location=&quot;Office 3&quot; email=&quot;[email protected]&quot; placeholders=&quot;1&quot; link=&quot;https://www.draw.io&quot; id=&quot;dNxyNK7c78bLwvsdeMH5-18&quot;&gt;&#10; &lt;mxCell style=&quot;label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;&quot; parent=&quot;dNxyNK7c78bLwvsdeMH5-11&quot; vertex=&quot;1&quot;&gt;&#10; &lt;mxGeometry x=&quot;490&quot; y=&quot;180&quot; width=&quot;180&quot; height=&quot;80&quot; as=&quot;geometry&quot; /&gt;&#10; &lt;/mxCell&gt;&#10; &lt;/UserObject&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;140&quot; y=&quot;660&quot; width=&quot;570&quot; height=&quot;300&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="tazqR-jlQMPDV_MZ-rYC-0"><g data-cell-id="tazqR-jlQMPDV_MZ-rYC-1"><g data-cell-id="VPFQTBCB0J-yRa51enEa-0"><g><rect x="0" y="0" width="570" height="300" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/></g></g></g></g></g></svg>
4 changes: 4 additions & 0 deletions docs/_static/Structures.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. hide-toc: true
HydroRollCore
=========
==============

.. include:: ../../README.rst
:start-after: .. index-start
Expand All @@ -11,13 +11,13 @@ HydroRollCore
.. toctree::
:hidden:

Quick start <pages/quick-start.rst>
快速开始 <pages/quick-start.rst>


.. toctree::
:caption: Development
:hidden:

CONTRIBUTING <pages/development/contributing.rst>
CHANGELOG <changelog.rst>
贡献指南 <pages/contributing.rst>
变更日志 <changelog.rst>
COPYING <COPYING.rst>
2 changes: 1 addition & 1 deletion docs/source/pages/contributing.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.. include:: ../../../CONTRIBUTING.md
.. include:: ../../../CONTRIBUTING.rst
2 changes: 2 additions & 0 deletions hrc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .LibCore import *

from . import rules
# from . import
22 changes: 22 additions & 0 deletions hrc/rules/BaseRule/CharacterCard.py
Original file line number Diff line number Diff line change
@@ -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):
...

13 changes: 1 addition & 12 deletions hrc/rules/BaseRule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@
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):
Expand Down
12 changes: 11 additions & 1 deletion hrc/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
from . import BaseRule
from typing import Generic, Any, Type

from abc import ABC

from . import BaseRule
from ..typing import RulesT


class Rules(ABC, Generic[RulesT]):
...

File renamed without changes.
7 changes: 7 additions & 0 deletions hrc/typing.py
Original file line number Diff line number Diff line change
@@ -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]")
2 changes: 1 addition & 1 deletion tests/test_BRP_pdfquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
pdf = PDFQuery("../rule_book/BRP SRD 1.0 CHN.pdf")
pdf.load()

print(pdf.get_page(1))
print([dir(x) for x in dir(pdf.get_page(1))])
28 changes: 23 additions & 5 deletions tests/test_BaseRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,31 @@
# ==============================================

# MyRule
from hrc.rules.BaseRule import JudgeRule
import hrc
from hrc.rules import BaseRule, Rules
from hrc.rules.BaseRule import CharacterCard, JudgeRule

class JudgeAttr(JudgeRule.Attribute):
"""来自判定规则 - 属性判定

属性判定规则(模式)"""
class JudgeAttr(JudgeRule.Attribute):
"""属性判定规则"""


class JudgeCustom(JudgeRule.Custom):
...
"""自定义判定规则"""


class ChaAttr(CharacterCard.Attribute):
"""人物卡属性列表"""


class ChaSkill(CharacterCard.Skill):
"""人物卡技能列表"""


class ThePool(Rules[JudgeAttr, JudgeCustom]):
"""规则包[池]"""

__config__ = 'ThePool'



0 comments on commit dcadac7

Please sign in to comment.