#[repr(C)]pub struct StatModify {
pub header: Header,
pub entity: Entity,
pub key: u32,
pub modifier: StatModifierData,
pub flags: u32,
pub duration_ms: u64,
}Expand description
Sets or removes a mod’s modifier on an entity, for
HostApi::stat_modify.
§Examples
use enshwick::abi::{Header, StatModifierData, StatModify};
let blessing = StatModify {
header: Header::of::<StatModify>(),
entity: enshwick::Entity(2),
key: 7,
modifier: StatModifierData { stat: 0, op: StatModifierData::ADD, reserved: [0; 3], value: 50.0 },
flags: 0,
duration_ms: 60_000,
};
assert_eq!(blessing.flags & StatModify::REMOVE, 0);Fields§
§header: HeaderSize and version of this struct.
entity: EntityThe entity.
key: u32The mod’s own key; a modifier with the same mod, key and stat replaces the one before.
modifier: StatModifierDataThe modifier.
flags: u32§duration_ms: u64How long it lasts in milliseconds; 0 until removed.
Implementations§
Trait Implementations§
Source§impl Clone for StatModify
impl Clone for StatModify
impl Copy for StatModify
Source§impl Debug for StatModify
impl Debug for StatModify
impl Headed for StatModify
Source§impl PartialEq for StatModify
impl PartialEq for StatModify
impl StructuralPartialEq for StatModify
Auto Trait Implementations§
impl Freeze for StatModify
impl RefUnwindSafe for StatModify
impl Send for StatModify
impl Sync for StatModify
impl Unpin for StatModify
impl UnsafeUnpin for StatModify
impl UnwindSafe for StatModify
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