fix: datetime format

main
beiyanpiki 1 year ago
parent 0dd51b175c
commit 33bba56bba

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -4,7 +4,7 @@ from pathlib import Path
from typing import Optional, Tuple, Dict
from src.model import PSet, Series, Label, CardType, Mechanic, CollectionAttr, Rarity, PokemonAttr, Energy, Stage, \
Ability, Resistance, Attack, Card, Weakness, EnergyAttr
Ability, Resistance, Attack, Card, EnergyAttr
raw_json_path = '../PTCG-CHS-Datasets/ptcg_chs_infos.json'
@ -206,9 +206,8 @@ def get_pokemon_attr(card) -> PokemonAttr:
ancient_trait = None
weakness_type = card['details'].get('weaknessType', None)
weakness_value = card['details'].get('weaknessFormula', None)
if weakness_type is not None:
weakness = Weakness(get_energy_by_eid_yorenid(weakness_type), weakness_value)
weakness = get_energy_by_eid_yorenid(weakness_type)
else:
weakness = None

@ -108,21 +108,6 @@ class Resistance:
}
class Weakness:
weakness_type: Energy
weakness_value: str
def __init__(self, weakness_type: Energy, weakness_value: str) -> None:
self.weakness_type = weakness_type
self.weakness_value = weakness_value
def __json__(self):
return {
"weakness_type": self.weakness_type.value,
"weakness_value": self.weakness_value
}
class Attack:
name: str
text: str
@ -169,7 +154,7 @@ class PokemonAttr:
hp: int
ability: Optional[Ability]
ancient_trait: Optional[AncientTrait]
weakness: Optional[Weakness]
weakness: Optional[Energy]
resistance: Optional[Resistance]
retreat_cost: int
pokedex: str
@ -181,7 +166,7 @@ class PokemonAttr:
hp: int,
ability: Optional[Ability],
ancient_trait: Optional[AncientTrait],
weakness: Optional[Weakness],
weakness: Optional[Energy],
resistance: Optional[Resistance],
retreat_cost: int,
pokedex: str,
@ -205,7 +190,7 @@ class PokemonAttr:
'hp': self.hp,
'ability': self.ability.__json__() if self.ability else None,
'ancient_trait': self.ancient_trait.value if self.ancient_trait else None,
'weakness': self.weakness.__json__() if self.weakness else None,
'weakness': self.weakness.value if self.weakness else None,
'resistance': self.resistance.__json__() if self.resistance else None,
'retreat_cost': self.retreat_cost,
'pokedex': self.pokedex,
@ -293,10 +278,10 @@ class Card:
self.effect_id = (f"{self.name}|"
f"{self.pokemon_attr.stage.value}|"
f"{self.pokemon_attr.hp}|"
f"{self.pokemon_attr.energy_type.value}|"
f"{self.pokemon_attr.ability.name if self.pokemon_attr.ability else ''}|"
f"{[attack.name for attack in self.pokemon_attr.attacks]}|"
f"{self.pokemon_attr.weakness.weakness_type if self.pokemon_attr.weakness else ''}|"
f"{self.pokemon_attr.weakness.weakness_value if self.pokemon_attr.weakness else ''}|"
f"{self.pokemon_attr.weakness.value if self.pokemon_attr.weakness else ''}|"
f"{self.pokemon_attr.resistance.resistance_type.value if self.pokemon_attr.resistance else ''}|"
f"{self.pokemon_attr.resistance.resistance_value if self.pokemon_attr.resistance else ''}|"
f"{self.pokemon_attr.retreat_cost}")

Loading…
Cancel
Save