mirror of
https://github.com/PaiGramTeam/StarRailDamageCal.git
synced 2024-11-28 18:19:25 +00:00
30 lines
701 B
Python
30 lines
701 B
Python
|
from typing import Dict, Union
|
||
|
|
||
|
from msgspec import Struct
|
||
|
|
||
|
|
||
|
class RelicSetStatusAdd(Struct):
|
||
|
Property: str
|
||
|
Value: float
|
||
|
|
||
|
|
||
|
class RelicSetSkillModel(Struct):
|
||
|
RelicSet: Dict[str, Dict[str, Union[RelicSetStatusAdd, None]]]
|
||
|
|
||
|
@classmethod
|
||
|
def from_json(cls, data: Dict):
|
||
|
return cls(
|
||
|
RelicSet={
|
||
|
str(k): {
|
||
|
str(k2): RelicSetStatusAdd(
|
||
|
Property=v2["Property"],
|
||
|
Value=v2["Value"],
|
||
|
)
|
||
|
if v2
|
||
|
else None
|
||
|
for k2, v2 in v.items()
|
||
|
}
|
||
|
for k, v in data.items()
|
||
|
},
|
||
|
)
|