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§
Sourcefn cast_magic(
&mut self,
caster: Entity,
spell: Handle<Spell>,
targets: Option<Vec<Entity>>,
) -> &mut Self
fn cast_magic( &mut self, caster: Entity, spell: Handle<Spell>, targets: Option<Vec<Entity>>, ) -> &mut Self
Cast a spell from caster at optional targets.
Sourcefn apply_enchantment(
&mut self,
target: Entity,
enchantment: Enchantment,
) -> &mut Self
fn apply_enchantment( &mut self, target: Entity, enchantment: Enchantment, ) -> &mut Self
Apply enchantment to target. The target must have the crate::enchanting::Enchantable component.
Sourcefn remove_enchantment(
&mut self,
target: Entity,
name: impl Into<String>,
) -> &mut Self
fn remove_enchantment( &mut self, target: Entity, name: impl Into<String>, ) -> &mut Self
Remove the enchantment named name from target.
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.