diff --git a/src/__init__.py b/clashnetlib/__init__.py similarity index 100% rename from src/__init__.py rename to clashnetlib/__init__.py diff --git a/src/decision_maker.py b/clashnetlib/decision_maker.py similarity index 100% rename from src/decision_maker.py rename to clashnetlib/decision_maker.py diff --git a/clashnetlib/demo.py b/clashnetlib/demo.py new file mode 100644 index 0000000..dbceebd --- /dev/null +++ b/clashnetlib/demo.py @@ -0,0 +1,24 @@ +from .implements.fight_decision_maker import FightDecisionMaker, FightDecision + +import numpy as np + + +def sendImageToAPI(image: np.ndarray) -> FightDecision: + # returns some json response object + return FightDecision({"cardIndex": 0, "location": (0, 0)}) + + +class ClientFightDecisionMaker(FightDecisionMaker): + def make_decision(self) -> FightDecision: + image = self.inputs[-1] + response = sendImageToAPI(image) + + # process response and return decision + return response + +def main() -> None: + decision_maker = ClientFightDecisionMaker() + image = np.random.rand(100, 100) + decision_maker.add_input(image) + decision = decision_maker.make_decision() + print(decision) diff --git a/src/implements/__init__.py b/clashnetlib/implements/__init__.py similarity index 100% rename from src/implements/__init__.py rename to clashnetlib/implements/__init__.py diff --git a/src/implements/fight_decision_maker.py b/clashnetlib/implements/fight_decision_maker.py similarity index 100% rename from src/implements/fight_decision_maker.py rename to clashnetlib/implements/fight_decision_maker.py diff --git a/pyproject.toml b/pyproject.toml index 9fcdad7..1fa5f22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "clash-net-lib" -packages = [{ include = "src" }] +packages = [{ include = "clashnetlib" }] version = "v0.0.0" description = "The API for Clash Net" readme = "README.md"