pub struct EntityPriorityRef<'a, E: Copy + Eq + Hash> { /* private fields */ }Expand description
Read-only view of an entity’s priority state in one priority layer
(global OR per-user). Acquired via the corresponding *_priority() method
on WorldServer, Client, or their Bevy-adapter equivalents.
Implementations§
Source§impl<'a, E: Copy + Eq + Hash> EntityPriorityRef<'a, E>
impl<'a, E: Copy + Eq + Hash> EntityPriorityRef<'a, E>
Sourcepub fn empty(entity: E) -> Self
pub fn empty(entity: E) -> Self
Construct an empty read-only handle (no backing entry). Reads return
defaults: accumulated() == 0.0, gain() == None. Used when the
caller wants a handle for an entity whose layer doesn’t yet exist.
Sourcepub fn accumulated(&self) -> f32
pub fn accumulated(&self) -> f32
Current accumulated priority value for this layer. Higher = more urgent.
Returns 0.0 if this entity has no accumulator entry yet.
Sourcepub fn gain(&self) -> Option<f32>
pub fn gain(&self) -> Option<f32>
Current per-tick gain override for this layer. None means the default
(1.0) applies.
Sourcepub fn is_overridden(&self) -> bool
pub fn is_overridden(&self) -> bool
Returns true if a per-tick gain override is currently active.
Auto Trait Implementations§
impl<'a, E> Freeze for EntityPriorityRef<'a, E>where
E: Freeze,
impl<'a, E> RefUnwindSafe for EntityPriorityRef<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for EntityPriorityRef<'a, E>where
E: Send,
impl<'a, E> Sync for EntityPriorityRef<'a, E>where
E: Sync,
impl<'a, E> Unpin for EntityPriorityRef<'a, E>where
E: Unpin,
impl<'a, E> UnsafeUnpin for EntityPriorityRef<'a, E>where
E: UnsafeUnpin,
impl<'a, E> UnwindSafe for EntityPriorityRef<'a, E>where
E: UnwindSafe,
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