22 lines
542 B
Rust
22 lines
542 B
Rust
|
use pkmn_lib::dynamic_data::models::battle::Battle;
|
||
|
use serde::Deserialize;
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
#[serde(rename_all = "snake_case")]
|
||
|
pub enum TestDataGetter {
|
||
|
PokemonHealth { index: [u8; 2] },
|
||
|
}
|
||
|
|
||
|
impl TestDataGetter {
|
||
|
pub fn get(&self, battle: &Battle) -> String {
|
||
|
match self {
|
||
|
TestDataGetter::PokemonHealth { index } => battle
|
||
|
.get_pokemon(index[0], index[1])
|
||
|
.as_ref()
|
||
|
.unwrap()
|
||
|
.current_health()
|
||
|
.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|