use crate::{ExternRef, ExternalReferenceType, Pokemon}; #[derive(Clone)] pub struct ChoiceQueue { reference: ExternRef, } impl ChoiceQueue { #[cfg(not(feature = "mock_data"))] pub fn new(reference: ExternRef) -> Self { Self { reference } } pub fn move_pokemon_choice_next(&self, pokemon: &Pokemon) -> bool { unsafe { choice_queue_move_pokemon_choice_next(self.reference, pokemon.reference()) } } } #[cfg(not(feature = "mock_data"))] impl ExternalReferenceType for ChoiceQueue { fn from_extern_value(reference: ExternRef) -> Self { Self::new(reference) } } extern "wasm" { fn choice_queue_move_pokemon_choice_next( r: ExternRef, pokemon: ExternRef, ) -> bool; }