mirror of
https://github.com/PaiGramTeam/python-genshin-artifact.git
synced 2025-02-03 17:06:42 +00:00
🐛 Fix bug
This commit is contained in:
parent
eba979cc7e
commit
aa9049f851
@ -1,9 +1,9 @@
|
||||
from genshin_artifact_function import get_damage_analysis as _get_damage_analysis
|
||||
|
||||
from python_genshin_artifact.models.characterInfo import CharacterInfo
|
||||
from python_genshin_artifact.models.calculator import CalculatorConfig
|
||||
from python_genshin_artifact.models.damage.analysis import DamageAnalysis
|
||||
|
||||
|
||||
def get_damage_analysis(value: CharacterInfo) -> DamageAnalysis:
|
||||
ret = _get_damage_analysis(value=value.json())
|
||||
def get_damage_analysis(value: CalculatorConfig) -> DamageAnalysis:
|
||||
ret = _get_damage_analysis(value.json())
|
||||
return DamageAnalysis.parse_raw(ret)
|
||||
|
@ -14,7 +14,7 @@ class CalculatorConfig(BaseModel):
|
||||
character: CharacterInfo
|
||||
weapon: WeaponInfo
|
||||
buffs: List[BuffInfo] = []
|
||||
artifact: List[ArtifactInfo] = []
|
||||
artifacts: List[ArtifactInfo] = []
|
||||
artifact_config: Optional[str] = None
|
||||
skill: SkillInfo
|
||||
enemy: Optional[EnemyInfo] = None
|
||||
|
@ -1,3 +1,5 @@
|
||||
from typing import Union
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@ -9,4 +11,4 @@ class CharacterInfo(BaseModel):
|
||||
skill1: int
|
||||
skill2: int
|
||||
skill3: int
|
||||
params: str = "NoConfig"
|
||||
params: Union[str, dict] = "NoConfig"
|
||||
|
@ -1,6 +1,7 @@
|
||||
from typing import Union
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class SkillInfo(BaseModel):
|
||||
index: str
|
||||
config: str = "NoConfig"
|
||||
index: int
|
||||
config: Union[str, dict] = "NoConfig"
|
||||
|
@ -1,3 +1,5 @@
|
||||
from typing import Union
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@ -6,4 +8,4 @@ class WeaponInfo(BaseModel):
|
||||
level: int
|
||||
ascend: bool
|
||||
refine: int
|
||||
params: str
|
||||
params: Union[str, dict] = "NoConfig"
|
||||
|
Loading…
Reference in New Issue
Block a user