def __deep_copy_state(self, state): table_deepcopy = Table.deserialize(state["table"].serialize()) return { "round_count": state["round_count"], "small_blind_amount": state["small_blind_amount"], "street": state["street"], "next_player": state["next_player"], "table": table_deepcopy }
def __deep_copy_state(self, state): table_deepcopy = Table.deserialize(state['table'].serialize()) return { 'round_count': state['round_count'], 'small_blind_amount': state['small_blind_amount'], 'street': state['street'], 'next_player': state['next_player'], 'table': table_deepcopy }
def deepcopy_game_state(game_state): tabledeepcopy = Table.deserialize(game_state["table"].serialize()) return { "round_count": game_state["round_count"], "small_blind_amount": game_state["small_blind_amount"], "street": game_state["street"], "next_player": game_state["next_player"], "table": tabledeepcopy }
def deepcopy_game_state(game_state): tabledeepcopy = Table.deserialize(game_state['table'].serialize()) return { 'round_count': game_state['round_count'], 'small_blind_amount': game_state['small_blind_amount'], 'street': game_state['street'], 'next_player': game_state['next_player'], 'table': tabledeepcopy }
def test_serialization(self): table = self.__setup_players_with_table() for card in table.deck.draw_cards(3): table.add_community_card(card) table.shift_dealer_btn() table.set_blind_pos(1, 2) serial = table.serialize() restored = Table.deserialize(serial) self.eq(table.dealer_btn, restored.dealer_btn) self.eq(Seats.serialize(table.seats), Seats.serialize(restored.seats)) self.eq(Deck.serialize(table.deck), Deck.serialize(restored.deck)) self.eq(table.get_community_card(), restored.get_community_card()) self.eq(1, restored.sb_pos()) self.eq(2, restored.bb_pos())