-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from typing import List | ||
|
||
from python_genshin_artifact.assets import Assets | ||
|
||
assets = Assets() | ||
|
||
character = assets.character.get("Yelan") | ||
locale = assets.locale.get("zh-cn") | ||
|
||
print(f"name {locale[character.get('name_locale')]}") | ||
|
||
for skill_map1 in character.get("skill_map1"): | ||
index = skill_map1.get("index") | ||
locale_index = skill_map1.get("locale_index") | ||
print(f"skill_map1 index {index} locale {locale[locale_index]}") | ||
|
||
|
||
for skill_map2 in character.get("skill_map2"): | ||
index = skill_map2.get("index") | ||
locale_index = skill_map2.get("locale_index") | ||
print(f"skill_map2 index {index} locale {locale[locale_index]}") | ||
|
||
for skill_map3 in character.get("skill_map3"): | ||
index = skill_map3.get("index") | ||
locale_index = skill_map3.get("locale_index") | ||
print(f"skill_map3 index {index} locale {locale[locale_index]}") | ||
|
||
print(locale.index("夜兰")) | ||
|
||
|
33 changes: 4 additions & 29 deletions
33
python_genshin_artifact_core/src/applications/input/calculator.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,15 @@ | ||
use mona::artifacts::Artifact; | ||
use mona::artifacts::effect_config::ArtifactConfigInterface; | ||
use mona_wasm::applications::common::{BuffInterface, CharacterInterface, EnemyInterface, SkillInterface, WeaponInterface}; | ||
use pyo3::prelude::*; | ||
use crate::applications::input::common::PyCharacterInterface; | ||
|
||
#[derive(Debug, Clone)] | ||
#[pyclass] | ||
pub struct CalculatorConfig { | ||
pub character: CharacterInterface, | ||
// pub weapon: WeaponInterface, | ||
// pub buffs: Vec<BuffInterface>, | ||
// pub artifacts: Vec<Artifact>, | ||
// pub artifact_config: Option<ArtifactConfigInterface>, | ||
// pub skill: SkillInterface, | ||
// pub enemy: Option<EnemyInterface>, | ||
pub character: PyCharacterInterface, | ||
} | ||
|
||
#[pymethods] | ||
impl CalculatorConfig { | ||
#[new] | ||
// #[args(buffs="Vec::new()", artifacts="Vec::new()", artifact_config="None", enemy="None")] | ||
fn new(character: CharacterInterface, | ||
// weapon: WeaponInterface, | ||
// buffs: Vec<BuffInterface>, | ||
// artifacts: Vec<Artifact>, | ||
// artifact_config: Option<ArtifactConfigInterface>, | ||
// skill: SkillInterface, | ||
// enemy: Option<EnemyInterface>, | ||
) -> Self { | ||
CalculatorConfig { | ||
character, | ||
// weapon, | ||
// buffs, | ||
// artifacts, | ||
// artifact_config, | ||
// skill, | ||
// enemy, | ||
} | ||
pub fn py_new( character: PyCharacterInterface) -> PyResult<Self> { | ||
Ok(Self {character}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pub mod calculator; | ||
pub mod common; | ||
pub mod character; | ||
pub mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod generate; | ||
pub mod wasm; | ||
pub mod input; | ||
pub mod input; |