pub struct RhaiEngine { /* private fields */ }Expand description
Wrapper around Rhai engine for executing card scripts Configured for deterministic, safe execution
Implementations§
Source§impl RhaiEngine
impl RhaiEngine
Sourcepub fn register_script(
&mut self,
card_id: String,
script: &str,
) -> Result<(), CardinalError>
pub fn register_script( &mut self, card_id: String, script: &str, ) -> Result<(), CardinalError>
Register a card script from source code
Sourcepub fn execute_ability(
&self,
card_id: &str,
context: ScriptContext,
) -> Result<Vec<Dynamic>, CardinalError>
pub fn execute_ability( &self, card_id: &str, context: ScriptContext, ) -> Result<Vec<Dynamic>, CardinalError>
Execute a card script’s ability Returns a list of effect descriptions as Dynamic values
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RhaiEngine
impl !RefUnwindSafe for RhaiEngine
impl Send for RhaiEngine
impl Sync for RhaiEngine
impl Unpin for RhaiEngine
impl !UnwindSafe for RhaiEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more