From aa3c5a018b296523a7b20e55652b8602666d5e6c Mon Sep 17 00:00:00 2001 From: ZaneYork Date: Tue, 28 Dec 2021 19:48:01 +0800 Subject: [PATCH] Fix BUG --- evaluate_server.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/evaluate_server.py b/evaluate_server.py index ce4c7a6..4df45a7 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -158,9 +158,10 @@ def predict(): return jsonify({'status': 7, 'message': 'the number of the other hand cards do not align with the number of cards left'}) # Last moves - last_moves = [] - for field in ['last_move_landlord', 'last_move_landlord_down', 'last_move_landlord_front', 'last_move_landlord_up']: - last_moves.append([RealCard2EnvCard[c] for c in request.form.get(field)]) + last_move_dict = {'landlord': [RealCard2EnvCard[c] for c in request.form.get('last_move_landlord')], + 'landlord_up': [RealCard2EnvCard[c] for c in request.form.get('last_move_landlord_up')], + 'landlord_front': [RealCard2EnvCard[c] for c in request.form.get('last_move_landlord_front')], + 'landlord_down': [RealCard2EnvCard[c] for c in request.form.get('last_move_landlord_down')]} # Played cards played_cards = {} @@ -177,7 +178,7 @@ def predict(): info_set.num_cards_left = num_cards_left info_set.card_play_action_seq = card_play_action_seq info_set.other_hand_cards = other_hand_cards - info_set.last_moves = last_moves + info_set.last_move_dict = last_move_dict info_set.played_cards = played_cards info_set.bomb_num = [int(x) for x in str.split(bomb_num, ',')] info_set.num_cards_left_dict['landlord'] = num_cards_left[0] @@ -258,6 +259,10 @@ class InfoSet(object): self.other_hand_cards = None self.legal_actions = None self.last_move = None + self.last_move_dict = {'landlord': [], + 'landlord_up': [], + 'landlord_front': [], + 'landlord_down': []} self.last_moves = None self.played_cards = None self.bomb_num = None