-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c035d29
commit c0ac53e
Showing
6 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters