Scriptable

Trait Scriptable 

Source
pub trait Scriptable {
    // Required methods
    fn spawn_script_core(
        &mut self,
        this: Arc<RwLock<dyn GameObject>>,
        spawner: Spawner,
    );
    fn spawn_script_handler(
        &mut self,
        this: Arc<RwLock<dyn GameObject>>,
        spawner: Spawner,
        event: Event<'static, UserEvent<Arc<dyn Any + Send + Sync>>>,
    );
    fn get_globals(&self) -> Result<Box<dyn Global>, &'static str>;
    fn set_globals(
        &mut self,
        globals: Box<dyn Global>,
    ) -> Result<(), &'static str>;
}
Expand description

A trait that provides scriptable functionality.

Required Methods§

Source

fn spawn_script_core( &mut self, this: Arc<RwLock<dyn GameObject>>, spawner: Spawner, )

Source

fn spawn_script_handler( &mut self, this: Arc<RwLock<dyn GameObject>>, spawner: Spawner, event: Event<'static, UserEvent<Arc<dyn Any + Send + Sync>>>, )

Source

fn get_globals(&self) -> Result<Box<dyn Global>, &'static str>

Source

fn set_globals(&mut self, globals: Box<dyn Global>) -> Result<(), &'static str>

Implementors§