python-genshin-artifact/python_genshin_artifact/calculator.py

18 lines
652 B
Python
Raw Normal View History

2023-10-22 07:23:32 +00:00
from genshin_artifact_core import (
get_damage_analysis as _get_damage_analysis,
get_transformative_damage as _get_transformative_damage,
)
2023-05-14 04:29:29 +00:00
2023-05-16 09:25:12 +00:00
from python_genshin_artifact.models.calculator import CalculatorConfig
2023-10-22 07:23:32 +00:00
from python_genshin_artifact.models.damage.analysis import DamageAnalysis, TransformativeDamage
2023-05-14 04:29:29 +00:00
2023-05-16 09:25:12 +00:00
def get_damage_analysis(value: CalculatorConfig) -> DamageAnalysis:
ret = _get_damage_analysis(value.json())
2023-05-14 04:29:29 +00:00
return DamageAnalysis.parse_raw(ret)
2023-10-22 07:23:32 +00:00
def get_transformative_damage(value: CalculatorConfig) -> TransformativeDamage:
ret = _get_transformative_damage(value.json())
return TransformativeDamage.parse_raw(ret)