Fix some scripts
This commit is contained in:
parent
4c4faf054d
commit
6cfedaa7d3
3 changed files with 8 additions and 2 deletions
|
|
@ -45,6 +45,7 @@ _COLOR_CATEGORIES = {
|
|||
'Red': 'r',
|
||||
'Green': 'g',
|
||||
'Multicolor': 'm',
|
||||
'Multicolored': 'm',
|
||||
'Hybrid': 'h',
|
||||
'Colorless': 'c',
|
||||
'Land': 'land',
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ def get_copies_to_add(card):
|
|||
if tag == 'uncommon':
|
||||
return [card] * (2 - 1)
|
||||
if tag == 'dual':
|
||||
return [card] * (7 - 1)
|
||||
return [card] * (8 - 1)
|
||||
return []
|
||||
|
||||
|
||||
|
|
@ -37,9 +37,14 @@ def main():
|
|||
|
||||
cube: List[CubeCard] = cubecobra_csv.load_cube(csv_path)
|
||||
names_to_add = []
|
||||
unique_cards = set()
|
||||
for card in cube:
|
||||
copies_to_add = get_copies_to_add(card)
|
||||
names_to_add.extend([card.name for card in copies_to_add])
|
||||
unique_cards.add(card.name)
|
||||
|
||||
print(f'Unique cards: {len(unique_cards)}')
|
||||
print(f'Total cards: {len(cube)}')
|
||||
|
||||
with open(OUTPUT_FILENAME, 'wb') as f:
|
||||
full_pool_contents = '\n'.join(names_to_add).encode('utf-8')
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ if __name__ == '__main__':
|
|||
|
||||
# 1. If you have your cube in Cube Cobra and want to filter per tag
|
||||
# csv_path = cubecobra_csv.request_cube_csv('TheElegantCube_fetched', 'elegant')
|
||||
# cube_list = cube_json.load_cube_from_csv(csv_path)
|
||||
# cube_list = cubecobra_csv.load_cube_names(csv_path)
|
||||
|
||||
# 2. If you have your cube in Cube Cobra and want to consider only cards with a certain tag
|
||||
csv_path = cubecobra_csv.request_cube_csv('TheElegantCube_fetched', 'elegant')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue