[][src]Struct nano_ecs::MaskStorage

pub struct MaskStorage {
    pub masks: Vec<(u64, u64)>,
    pub offsets: Vec<usize>,
}

Stores masks efficiently and allows fast iteration.

Fields

masks: Vec<(u64, u64)>

Stores (active, initial) masks.

offsets: Vec<usize>

Stores the offsets of the mask.

Implementations

impl MaskStorage[src]

pub fn new() -> MaskStorage[src]

Creates a new mask storage.

pub fn optimize(&mut self, n: usize) -> Vec<usize>[src]

Sorts optimally and returns a sort to update entity slices and components.

pub fn next(
    &self,
    mask_pat: u64,
    i: &mut usize,
    n: usize
) -> Option<(usize, usize)>
[src]

Gets the next range of entities with active mask pattern.

pub fn mask_of(&self, cid: usize) -> u64[src]

Returns the active mask of component id.

pub fn init_mask_of(&self, id: usize) -> u64[src]

Returns the initial mask of entity id.

pub fn both_masks_of(&self, id: usize) -> (u64, u64)[src]

Returns both active and initial mask of entity id.

pub fn push(&mut self, mask: u64, id: usize)[src]

Pushes a new mask.

pub fn update(&mut self, mask: u64, id: usize, n: usize)[src]

Updates a mask for an entity.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.