PkmnLib_rs/src/script_implementations/rune/wrappers/pokemon.rs

23 lines
531 B
Rust

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