2022-06-17 17:53:33 +00:00
|
|
|
use serde::Deserialize;
|
2023-06-17 17:05:27 +00:00
|
|
|
use std::sync::Arc;
|
2022-06-17 17:53:33 +00:00
|
|
|
|
2022-06-19 19:34:08 +00:00
|
|
|
use pkmn_lib::dynamic_data::Battle;
|
|
|
|
|
2022-06-17 17:53:33 +00:00
|
|
|
#[derive(Deserialize)]
|
|
|
|
#[serde(rename_all = "snake_case")]
|
|
|
|
pub enum TestDataGetter {
|
|
|
|
PokemonHealth { index: [u8; 2] },
|
|
|
|
}
|
|
|
|
|
|
|
|
impl TestDataGetter {
|
2023-06-17 17:05:27 +00:00
|
|
|
pub fn get(&self, battle: &Arc<Battle>) -> String {
|
2022-06-17 17:53:33 +00:00
|
|
|
match self {
|
|
|
|
TestDataGetter::PokemonHealth { index } => battle
|
|
|
|
.get_pokemon(index[0], index[1])
|
|
|
|
.as_ref()
|
|
|
|
.unwrap()
|
|
|
|
.current_health()
|
|
|
|
.to_string(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|