Esempio n. 1
0
 def __evaluate_next_player_by_turns(self, game_status_tmp: GameStatus = None) -> bool:
     new_turn = False
     if controllers.GameController.GameController.game.turns.magnitude == Magnitude.SINGLE:
         new_turn = True
         if game_status_tmp.turns.ordering == Ordering.STRICT:
             game_status_tmp = game_status_tmp.assign_speaker_assign_listener()
         elif game_status_tmp.turns.ordering == Ordering.LIBERAL:
             # TODO implement Ordering.LIBERAL
             pass
     elif controllers.GameController.GameController.game.turns.magnitude == Magnitude.MULTIPLE:
         if game_status_tmp.max_moves_per_turn is not None:
             if self.multiple_moves_count >= game_status_tmp.max_moves_per_turn:
                 new_turn = True
                 if game_status_tmp.turns.ordering == Ordering.STRICT:
                     game_status_tmp = game_status_tmp.assign_speaker_assign_listener()
                 elif game_status_tmp.turns.ordering == Ordering.LIBERAL:
                     # TODO implement Ordering.LIBERAL
                     pass
                 self.__multiple_moves_count = 0
             else:
                 new_turn = False
                 self.__turn_count_increment()
         elif game_status_tmp.last_interaction_move is not None:
             if game_status_tmp.last_interaction_move.final:
                 new_turn = True
                 if game_status_tmp.turns.ordering == Ordering.STRICT:
                     game_status_tmp = game_status_tmp.assign_speaker_assign_listener()
                 elif game_status_tmp.turns.ordering == Ordering.LIBERAL:
                     # TODO implement Ordering.LIBERAL
                     pass
             else:
                 new_turn = False
     if game_status_tmp.all_players_did_move:
         self.__initial = False
     return new_turn
 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