Skip to main content

EntityPriorityRef

Struct EntityPriorityRef 

Source
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>

Source

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.

Source

pub fn entity(&self) -> E

Returns the entity this handle refers to.

Source

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.

Source

pub fn gain(&self) -> Option<f32>

Current per-tick gain override for this layer. None means the default (1.0) applies.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V