pub struct EntityAttributeInstance { /* private fields */ }
Expand description
An instance of an Entity Attribute.
Implementations§
source§impl EntityAttributeInstance
impl EntityAttributeInstance
sourcepub fn new(attribute: EntityAttribute) -> Self
pub fn new(attribute: EntityAttribute) -> Self
Creates a new instance of an Entity Attribute.
sourcepub fn new_with_value(attribute: EntityAttribute, base_value: f64) -> Self
pub fn new_with_value(attribute: EntityAttribute, base_value: f64) -> Self
Creates a new instance of an Entity Attribute with a value.
sourcepub fn attribute(&self) -> EntityAttribute
pub fn attribute(&self) -> EntityAttribute
Gets the attribute.
sourcepub fn base_value(&self) -> f64
pub fn base_value(&self) -> f64
Gets the base value of the attribute.
sourcepub fn compute_value(&self) -> f64
pub fn compute_value(&self) -> f64
Gets the computed value of the attribute.
sourcepub fn with_add_modifier(&mut self, uuid: Uuid, modifier: f64) -> &mut Self
pub fn with_add_modifier(&mut self, uuid: Uuid, modifier: f64) -> &mut Self
Sets an add modifier.
If the modifier already exists, it will be overwritten.
Returns a mutable reference to self.
sourcepub fn with_multiply_base_modifier(
&mut self,
uuid: Uuid,
modifier: f64,
) -> &mut Self
pub fn with_multiply_base_modifier( &mut self, uuid: Uuid, modifier: f64, ) -> &mut Self
Sets a multiply base modifier.
If the modifier already exists, it will be overwritten.
Returns a mutable reference to self.
sourcepub fn with_multiply_total_modifier(
&mut self,
uuid: Uuid,
modifier: f64,
) -> &mut Self
pub fn with_multiply_total_modifier( &mut self, uuid: Uuid, modifier: f64, ) -> &mut Self
Sets a multiply total modifier.
If the modifier already exists, it will be overwritten.
Returns a mutable reference to self.
sourcepub fn with_modifier(
&mut self,
uuid: Uuid,
modifier: f64,
operation: EntityAttributeOperation,
) -> &mut Self
pub fn with_modifier( &mut self, uuid: Uuid, modifier: f64, operation: EntityAttributeOperation, ) -> &mut Self
Sets a value modifier based on the operation.
If the modifier already exists, it will be overwritten.
Returns a mutable reference to self.
sourcepub fn remove_modifier(&mut self, uuid: Uuid)
pub fn remove_modifier(&mut self, uuid: Uuid)
Removes a modifier.
sourcepub fn clear_modifiers(&mut self)
pub fn clear_modifiers(&mut self)
Clears all modifiers.
sourcepub fn has_modifier(&self, uuid: Uuid) -> bool
pub fn has_modifier(&self, uuid: Uuid) -> bool
Checks if a modifier exists.
Trait Implementations§
source§impl Clone for EntityAttributeInstance
impl Clone for EntityAttributeInstance
source§fn clone(&self) -> EntityAttributeInstance
fn clone(&self) -> EntityAttributeInstance
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Component for EntityAttributeInstance
impl Component for EntityAttributeInstance
source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
§fn register_component_hooks(_hooks: &mut ComponentHooks)
fn register_component_hooks(_hooks: &mut ComponentHooks)
ComponentHooks
].source§impl Debug for EntityAttributeInstance
impl Debug for EntityAttributeInstance
source§impl PartialEq for EntityAttributeInstance
impl PartialEq for EntityAttributeInstance
impl StructuralPartialEq for EntityAttributeInstance
Auto Trait Implementations§
impl Freeze for EntityAttributeInstance
impl RefUnwindSafe for EntityAttributeInstance
impl Send for EntityAttributeInstance
impl Sync for EntityAttributeInstance
impl Unpin for EntityAttributeInstance
impl UnwindSafe for EntityAttributeInstance
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
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId), )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Bundle
]’s component ids. This will be None
if the component has not been registered.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.