Struct AttributeModifier
#[non_exhaustive]pub struct AttributeModifier {
pub id: Identifier,
pub amount: f64,
pub operation: AttributeOperation,
}Expand description
An attribute modifier (vanilla’s AttributeModifier): its id, which is
unique on one attribute of one entity, the amount and the operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: IdentifierThe modifier’s id (mymod:sprint_boost).
amount: f64The amount the operation applies.
operation: AttributeOperationHow it applies.
Implementations§
§impl AttributeModifier
impl AttributeModifier
pub fn new(
id: Identifier,
amount: f64,
operation: AttributeOperation,
) -> AttributeModifier
pub fn new( id: Identifier, amount: f64, operation: AttributeOperation, ) -> AttributeModifier
A modifier with id id.
Trait Implementations§
§impl Clone for AttributeModifier
impl Clone for AttributeModifier
§fn clone(&self) -> AttributeModifier
fn clone(&self) -> AttributeModifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for AttributeModifier
impl Debug for AttributeModifier
§impl PartialEq for AttributeModifier
impl PartialEq for AttributeModifier
impl StructuralPartialEq for AttributeModifier
Auto Trait Implementations§
impl Freeze for AttributeModifier
impl RefUnwindSafe for AttributeModifier
impl Send for AttributeModifier
impl Sync for AttributeModifier
impl Unpin for AttributeModifier
impl UnsafeUnpin for AttributeModifier
impl UnwindSafe for AttributeModifier
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
Mutably borrows from an owned value. Read more