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

21 lines
498 B
Rust

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::<RunePokemon>()?;
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);