Struct veloren_common::comp::buff::Buff
source · pub struct Buff {
pub kind: BuffKind,
pub data: BuffData,
pub cat_ids: Vec<BuffCategory>,
pub end_time: Option<Time>,
pub start_time: Time,
pub effects: Vec<BuffEffect>,
pub source: BuffSource,
}
Expand description
Actual de/buff.
Buff can timeout after some time if time
is Some. If time
is None,
Buff will last indefinitely, until removed manually (by some action, like
uncursing).
Buff has a kind, which is used to determine the effects in a builder function.
To provide more classification info when needed, buff can be in one or more buff category.
Fields§
§kind: BuffKind
§data: BuffData
§cat_ids: Vec<BuffCategory>
§end_time: Option<Time>
§start_time: Time
§effects: Vec<BuffEffect>
§source: BuffSource
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Buff
impl<'de> Deserialize<'de> for Buff
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Buff
impl PartialEq for Buff
source§impl PartialOrd for Buff
impl PartialOrd for Buff
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreAuto Trait Implementations§
impl RefUnwindSafe for Buff
impl Send for Buff
impl Sync for Buff
impl Unpin for Buff
impl UnwindSafe for Buff
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
§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
§fn convert_into<F>(
&self,
_: F
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data
) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data
) using
entity to marker mapping function