Skip to content

Commit

Permalink
CardDictionary.csv出力機能を削除(mtgatracker側でやる)
Browse files Browse the repository at this point in the history
  • Loading branch information
poslogithub committed Feb 18, 2022
1 parent eb947fe commit be20833
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
43 changes: 0 additions & 43 deletions source/mtga/models/card_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,50 +128,7 @@ def search(self, id_or_keyword, direct_match_returns_single=False):
if keyword_clean in card.name:
results.append(card)
return results

def get_real_cards(self, name="", pretty_name="", cost=None, color_identity=None, card_type="", sub_types="",
abilities=None, set="", rarity="", collectible=True, set_number=0, mtga_id=0,
is_token=False, is_secondary_card=False, is_rebalanced=False):
results = []
for card in self.cards:
if name and card.name != name:
continue
if pretty_name and card.pretty_name != pretty_name:
continue
if cost and card.cost != cost:
continue
if color_identity and card.color_identity != color_identity:
continue
if card_type and card.card_type != card_type:
continue
if sub_types and card.sub_types != sub_types:
continue
if abilities and card.abilities != abilities:
continue
if set and card.set != set:
continue
if rarity and card.rarity != rarity:
continue
if card.collectible != collectible:
continue
if set_number and card.set_number != set_number:
continue
if mtga_id and card.mtga_id != mtga_id:
continue
if card.is_token != is_token:
continue
if card.is_secondary_card != is_secondary_card:
continue
if card.is_rebalanced != is_rebalanced:
continue

results.append(card)

return results

def open_booster(self, set, seed):
# レア/神話レア
rarity

class Zone(Pool):
def __init__(self, pool_name, zone_id=-1):
Expand Down
16 changes: 0 additions & 16 deletions source/mtga/set_data/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ def del_ruby(s):

listed_cardsets = list(set([card["set"] for card in cards]))

# To generate 'CardDictionary.csv' for ゆかりねっとコネクター NEO
CARD_DICTIONARY_FILENAME = "CardDictionary.csv"
card_dictionary_csv = []

for set_name in listed_cardsets:
used_classnames = []
set_name_class_cased = re.sub('[^0-9a-zA-Z_]', '', set_name)
Expand Down Expand Up @@ -139,11 +135,6 @@ def del_ruby(s):
card_name_class_cased_suffixed = card_name_class_cased
card_suffix = 2

# To generate 'CardDictionary.csv' for ゆかりねっとコネクター NEO
line = card_title + "," + card_title + "\n"
if line not in card_dictionary_csv:
card_dictionary_csv.append(line)

while card_name_class_cased_suffixed in used_classnames:
card_name_class_cased_suffixed = card_name_class_cased + str(card_suffix)
card_suffix += 1
Expand Down Expand Up @@ -260,10 +251,3 @@ def del_ruby(s):
# raise
card_set_obj = Set(set_name_class_cased, cards=set_card_objs)
dynamic_set_tuples.append((card_set_obj, all_abilities))

# To generate 'CardDictionary.csv' for ゆかりねっとコネクター NEO
card_dictionary_csv.sort(reverse=True)
with open(CARD_DICTIONARY_FILENAME, "w", encoding="utf-8") as f:
for line in card_dictionary_csv:
f.write(line)
print(os.path.abspath(CARD_DICTIONARY_FILENAME) + " was generated")

0 comments on commit be20833

Please sign in to comment.