Trait StatCommandsExt

Source
pub trait StatCommandsExt {
    // Required methods
    fn entity_stats<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>(
        &mut self,
        entity: Entity,
    ) -> ModifyStatEntityCommands<'_, StatCollection>;
    fn modify_stat<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>(
        &mut self,
        entity: Entity,
        stat_id: impl StatIdentifier + 'static + Send + Sync,
        modification_type: ModificationType,
    );
}

Required Methods§

Source

fn entity_stats<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>( &mut self, entity: Entity, ) -> ModifyStatEntityCommands<'_, StatCollection>

Returns a ModifyStatEntityCommands object for the given entity

Source

fn modify_stat<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>( &mut self, entity: Entity, stat_id: impl StatIdentifier + 'static + Send + Sync, modification_type: ModificationType, )

Modify a single stat on an entity

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<'a> StatCommandsExt for Commands<'a, 'a>

Source§

fn entity_stats<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>( &mut self, entity: Entity, ) -> ModifyStatEntityCommands<'_, StatCollection>

Get access to an object to modify entity stats

Source§

fn modify_stat<StatCollection: AsMut<Stats> + Send + Sync + 'static + Component>( &mut self, entity: Entity, stat_id: impl StatIdentifier + 'static + Send + Sync, modification_type: ModificationType, )

Modify a single stat on an entity

Implementors§