gym_splendor_code/envs/data/data_loader.py
def load_all_nobles(file: str = NOBLES_DATABASE_FILE) -> Set[Noble]:
    """Loads information about nobles from file and returns a set of cards."""
    set_of_nobles = set()
    nobles_database_file = open(file)
    reader = csv.reader(nobles_database_file)
    _ = next(reader, None)
    noble_id = 100
    for row in reader:
        price = GemsCollection({GemColor.BLACK: int(row[1]), GemColor.WHITE: int(row[2]), GemColor.RED: int(row[3]),
                                GemColor.BLUE: int(row[4]), GemColor.GREEN: int(row[5]), GemColor.GOLD: 0})
        new_noble = Noble(row[0], noble_id, price, int(row[6]))
        set_of_nobles.add(new_noble)
        id_to_noble_dict[noble_id] = new_noble
        name_to_noble_dict[new_noble.name] = new_noble
        noble_id += 1
    return set_of_nobles
Loads information about nobles from file and returns a set of cards.
Loads information about nobles from file and returns a set of cards.
Loads information about nobles from file and returns a set of cards .
def load_all_nobles(file: str = NOBLES_DATABASE_FILE) -> Set[Noble]:
    set_of_nobles = set()
    nobles_database_file = open(file)
    reader = csv.reader(nobles_database_file)
    _ = next(reader, None)
    noble_id = 100
    for row in reader:
        price = GemsCollection({GemColor.BLACK: int(row[1]), GemColor.WHITE: int(row[2]), GemColor.RED: int(row[3]),
                                GemColor.BLUE: int(row[4]), GemColor.GREEN: int(row[5]), GemColor.GOLD: 0})
        new_noble = Noble(row[0], noble_id, price, int(row[6]))
        set_of_nobles.add(new_noble)
        id_to_noble_dict[noble_id] = new_noble
        name_to_noble_dict[new_noble.name] = new_noble
        noble_id += 1
    return set_of_nobles
def load_all_nobles ( file : str = NOBLES_DATABASE_FILE ) -> Set [ Noble ] : set_of_nobles = set ( ) nobles_database_file = open ( file ) reader = csv . reader ( nobles_database_file ) _ = next ( reader , None ) noble_id = 100 for row in reader : price = GemsCollection ( { GemColor . BLACK : int ( row [ 1 ] ) , GemColor . WHITE : int ( row [ 2 ] ) , GemColor . RED : int ( row [ 3 ] ) , GemColor . BLUE : int ( row [ 4 ] ) , GemColor . GREEN : int ( row [ 5 ] ) , GemColor . GOLD : 0 } ) new_noble = Noble ( row [ 0 ] , noble_id , price , int ( row [ 6 ] ) ) set_of_nobles . add ( new_noble ) id_to_noble_dict [ noble_id ] = new_noble name_to_noble_dict [ new_noble . name ] = new_noble noble_id += 1 return set_of_nobles
Loads information about nobles from file and returns a set of cards.
Loads information about nobles from file and returns a set of cards .
"""Loads information about nobles from file and returns a set of cards."""
file
str