File size: 1,311 Bytes
463f868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import json
import os

from engine.game.data_loader import CardDataLoader


def check_card_1370():
    path = "data/cards_compiled.json"
    print(f"Checking {path}...")
    if not os.path.exists(path):
        print("File not found!")
        return

    loader = CardDataLoader(path)
    try:
        m, l, e = loader.load()
        print(f"Loaded {len(m)} members.")
        if 1370 in m:
            print("Card 1370 SUCCESFULLY LOADED into member dict.")
            card = m[1370]
            print(f"Card No: {card.card_no}")
            print(f"Abilities: {len(card.abilities)}")
        else:
            print("Card 1370 NOT FOUND in member dict.")
            keys = sorted(list(m.keys()))
            print(f"Max ID: {keys[-1]}")
            # Find if it's there as string?
            with open(path, "r", encoding="utf-8") as f:
                data = json.load(f)
                if "1370" in data.get("member_db", {}):
                    print("Found '1370' as string key in raw JSON.")
                else:
                    print("'1370' NOT in raw JSON member_db.")
    except Exception as ex:
        print(f"Error during loading: {ex}")
        import traceback

        traceback.print_exc()


if __name__ == "__main__":
    check_card_1370()