use crate::dynamic_data::ExecutingMove; use crate::script_implementations::rune::wrappers::{impl_rune_wrapper, RuneWrapper}; use rune::runtime::{AnyObj, Shared}; use rune::Any; use std::sync::Arc; pub fn register(module: &mut rune::Module) -> anyhow::Result<()> { module.ty::()?; Ok(()) } #[derive(Debug, Any)] pub struct RuneExecutingMove { inner: Arc, } impl RuneExecutingMove { #[rune::function] pub fn target_count(&self) -> usize { self.inner.target_count() } #[rune::function] pub fn number_of_hits(&self) -> u8 { self.inner.number_of_hits() } #[rune::function] pub fn user(&self) -> Shared { self.inner.user().wrap() } } impl_rune_wrapper!(&Arc, RuneExecutingMove);