use crate::defines::LevelInt; use crate::dynamic_data::Pokemon; use crate::script_implementations::rune::wrappers::impl_rune_wrapper; use rune::Any; pub fn register(module: &mut rune::Module) -> anyhow::Result<()> { module.ty::()?; module.function_meta(RunePokemon::level)?; Ok(()) } #[derive(Any)] pub struct RunePokemon(Pokemon); impl RunePokemon { #[rune::function] fn level(&self) -> LevelInt { self.0.level() } } impl_rune_wrapper!(&Pokemon, RunePokemon);