gym_splendor_code/envs/data/data_loader.py
def load_all_cards(file: str = CARDS_DATABASE_FILE) -> Set[Card]:
    """Loads information about cards from file and returns a set of cards."""
    set_of_cards = set()
    cards_database_file = open(file)
    reader = csv.reader(cards_database_file)
    _ = next(reader, None)
    card_id = 0
    for row in reader:
        price = GemsCollection({GemColor.BLACK: int(row[2]), GemColor.WHITE: int(row[3]), GemColor.RED: int(row[4]),
                                GemColor.BLUE: int(row[5]), GemColor.GREEN: int(row[6]), GemColor.GOLD: 0})
        card = Card(row[0], card_id, str_to_row[row[1]], price, str_to_color[row[7]], int(row[8]))
        set_of_cards.add(card)
        id_to_card_dict[card_id] = card
        name_to_card_dict[card.name] = card
        card_id += 1
    return set_of_cards
Loads information about cards from file and returns a set of cards.
Loads information about cards from file and returns a set of cards.
Loads information about cards from file and returns a set of cards .
def load_all_cards(file: str = CARDS_DATABASE_FILE) -> Set[Card]:
    set_of_cards = set()
    cards_database_file = open(file)
    reader = csv.reader(cards_database_file)
    _ = next(reader, None)
    card_id = 0
    for row in reader:
        price = GemsCollection({GemColor.BLACK: int(row[2]), GemColor.WHITE: int(row[3]), GemColor.RED: int(row[4]),
                                GemColor.BLUE: int(row[5]), GemColor.GREEN: int(row[6]), GemColor.GOLD: 0})
        card = Card(row[0], card_id, str_to_row[row[1]], price, str_to_color[row[7]], int(row[8]))
        set_of_cards.add(card)
        id_to_card_dict[card_id] = card
        name_to_card_dict[card.name] = card
        card_id += 1
    return set_of_cards
def load_all_cards ( file : str = CARDS_DATABASE_FILE ) -> Set [ Card ] : set_of_cards = set ( ) cards_database_file = open ( file ) reader = csv . reader ( cards_database_file ) _ = next ( reader , None ) card_id = 0 for row in reader : price = GemsCollection ( { GemColor . BLACK : int ( row [ 2 ] ) , GemColor . WHITE : int ( row [ 3 ] ) , GemColor . RED : int ( row [ 4 ] ) , GemColor . BLUE : int ( row [ 5 ] ) , GemColor . GREEN : int ( row [ 6 ] ) , GemColor . GOLD : 0 } ) card = Card ( row [ 0 ] , card_id , str_to_row [ row [ 1 ] ] , price , str_to_color [ row [ 7 ] ] , int ( row [ 8 ] ) ) set_of_cards . add ( card ) id_to_card_dict [ card_id ] = card name_to_card_dict [ card . name ] = card card_id += 1 return set_of_cards
Loads information about cards from file and returns a set of cards.
Loads information about cards from file and returns a set of cards .
"""Loads information about cards from file and returns a set of cards."""
file
str