def update_collector(self, game_status_tmp: GameStatus = None): """ This only updates current speaker and last interaction move, last_move should only be updated after validation in MoveValidationController :param game_status_tmp: :return: GameStatus """ if self.__interaction_move is not None: game_status_tmp.current_speaker = self.__interaction_move.playerName game_status_tmp.last_interaction_move = self.__interaction_move else: LoggingController.logger.warning( "Most likely json invalid format or id returned none") raise Exception(Constants.WRONG_MESSAGE_FORMAT) return game_status_tmp
def update_collector(self, game_status_tmp: GameStatus = None): if game_status_tmp.last_interaction_move: game_status_tmp = game_status_tmp.assign_speaker_assign_listener() game_status_tmp.speakers = game_status_tmp.get_speakers() game_status_tmp.current_speaker = game_status_tmp.last_interaction_move.playerName game_status_tmp.set_last_move_by_name(game_status_tmp.last_interaction_move.moveName) game_status_tmp.past_moves.append(game_status_tmp.last_interaction_move) game_status_tmp.set_did_move_flag(game_status_tmp.current_speaker) game_status_tmp.remove_interaction_move_from_moves(game_status_tmp.last_interaction_move) game_status_tmp.initial_turn = False game_status_tmp.clear_init_moves_dicts() else: LoggingController.logger.warning( "game_status_tmp.last_interaction_move: None\n\tLast move could not be parsed") GameEndController.finished = True return game_status_tmp