Пример #1
0
 def __generate_game_result(self, max_round, seats):
     config = self.__gen_config(max_round)
     result_message = MessageBuilder.build_game_result_message(
         config, seats)
     self.message_summarizer.summarize(result_message)
     self.game_summarizer.summarize(result_message)
     return result_message
Пример #2
0
 def test_game_result_message(self):
     config = self.__setup_config()
     seats = self.__setup_seats()
     state = self.__setup_state()
     message = MessageBuilder.build_game_result_message(config, seats)
     msg = message["message"]
     self.eq("notification", message["type"])
     self.eq(MessageBuilder.GAME_RESULT_MESSAGE, msg["message_type"])
     self.eq(DataEncoder.encode_game_information(config, seats), msg["game_information"])
 def test_game_result_message(self):
   config = self.__setup_config()
   seats = self.__setup_seats()
   state = self.__setup_state()
   message = MessageBuilder.build_game_result_message(config, seats)
   msg = message["message"]
   self.eq("notification", message["type"])
   self.eq(MessageBuilder.GAME_RESULT_MESSAGE, msg["message_type"])
   self.eq(DataEncoder.encode_game_information(config, seats), msg["game_information"])
Пример #4
0
 def _generate_game_result_event(self, game_state):
     dummy_config = {
             "initial_stack": None,
             "max_round": None,
             "small_blind_amount": None,
             "ante": None,
             "blind_structure": None
             }
     message = MessageBuilder.build_game_result_message(dummy_config, game_state["table"].seats)["message"]
     return [self.create_event(message)]
Пример #5
0
def _gen_game_result_message(table, config):
    compat_config = {
        'initial_stack': config['initial_stack'],
        'max_round': config['max_round'],
        'small_blind_amount': config['small_blind'],  # fill an interface gap
        'ante': config['ante'],
        'blind_structure': config['blind_structure']
    }
    msg = MessageBuilder.build_game_result_message(compat_config, table.seats)
    destination = -1
    return (destination, msg)
Пример #6
0
def _gen_game_result_message(table, config):
    compat_config = {
            'initial_stack': config['initial_stack'],
            'max_round': config['max_round'],
            'small_blind_amount': config['small_blind'],  # fill an interface gap
            'ante': config['ante'],
            'blind_structure': config['blind_structure']
            }
    msg = MessageBuilder.build_game_result_message(compat_config, table.seats)
    destination = -1
    return (destination, msg)
 def __game_result_message(self):
   config = self.__setup_config()
   seats = self.__setup_seats()
   return MessageBuilder.build_game_result_message(config, seats)
Пример #8
0
 def __generate_game_result(self, max_round, seats):
   config = self.__gen_config(max_round)
   result_message = MessageBuilder.build_game_result_message(config, seats)
   self.message_summarizer.summarize(result_message)
   return result_message