add json response store manager
This commit is contained in:
@ -5,6 +5,7 @@ from typing import Literal, Dict, Any
|
||||
import config
|
||||
from dto.requests import GameStartRequestDTO, GameDecisionRequestDTO
|
||||
from services.julius_baer_api_client import JuliusBaerApiClient
|
||||
from utils.storage.game_files_manager import store_game_round_data
|
||||
|
||||
|
||||
class Player:
|
||||
@ -33,8 +34,11 @@ class Player:
|
||||
|
||||
status = ''
|
||||
decision = self.make_decision(start_response.client_data)
|
||||
while status not in ['gameover', 'complete']:
|
||||
|
||||
decision_counter = 0
|
||||
store_game_round_data(start_response, decision_counter, str(start_response.session_id))
|
||||
|
||||
while status not in ['gameover', 'complete']:
|
||||
payload = GameDecisionRequestDTO(
|
||||
decision=decision,
|
||||
session_id=start_response.session_id,
|
||||
@ -45,8 +49,13 @@ class Player:
|
||||
print(decision_response.status, decision_response.score)
|
||||
status = decision_response.status
|
||||
decision = self.make_decision(decision_response.client_data)
|
||||
|
||||
store_game_round_data(decision_response, decision_counter, str(start_response.session_id))
|
||||
|
||||
decision_counter += 1
|
||||
time.sleep(1.5)
|
||||
|
||||
|
||||
def make_decision(self, client_data: Dict[str, Any]) -> Literal["Accept", "Reject"]:
|
||||
# Do your magic!
|
||||
|
||||
|
Reference in New Issue
Block a user