Skip to main content

CommandsExt

Trait CommandsExt 

Source
pub trait CommandsExt {
    // Required methods
    fn cast_magic(
        &mut self,
        caster: Entity,
        spell: Handle<Spell>,
        targets: Option<Vec<Entity>>,
    ) -> &mut Self;
    fn apply_enchantment(
        &mut self,
        target: Entity,
        enchantment: Enchantment,
    ) -> &mut Self;
    fn remove_enchantment(
        &mut self,
        target: Entity,
        name: impl Into<String>,
    ) -> &mut Self;
    fn trigger_enchantment(
        &mut self,
        source: Entity,
        name: impl Into<String>,
        targets: Option<Vec<Entity>>,
    ) -> &mut Self;
}

Required Methods§

Source

fn cast_magic( &mut self, caster: Entity, spell: Handle<Spell>, targets: Option<Vec<Entity>>, ) -> &mut Self

Cast a spell from caster at optional targets.

Source

fn apply_enchantment( &mut self, target: Entity, enchantment: Enchantment, ) -> &mut Self

Apply enchantment to target. The target must have the crate::enchanting::Enchantable component.

Source

fn remove_enchantment( &mut self, target: Entity, name: impl Into<String>, ) -> &mut Self

Remove the enchantment named name from target.

Source

fn trigger_enchantment( &mut self, source: Entity, name: impl Into<String>, targets: Option<Vec<Entity>>, ) -> &mut Self

Manually fire the runes enchantment named name on source, affecting targets.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CommandsExt for Commands<'_, '_>

Source§

fn cast_magic( &mut self, caster: Entity, spell: Handle<Spell>, targets: Option<Vec<Entity>>, ) -> &mut Self

Source§

fn apply_enchantment( &mut self, target: Entity, enchantment: Enchantment, ) -> &mut Self

Source§

fn remove_enchantment( &mut self, target: Entity, name: impl Into<String>, ) -> &mut Self

Source§

fn trigger_enchantment( &mut self, source: Entity, name: impl Into<String>, targets: Option<Vec<Entity>>, ) -> &mut Self

Implementors§