ComponentRegistry

Trait ComponentRegistry 

Source
pub trait ComponentRegistry<T: Copy> {
    // Required methods
    fn new() -> Self;
    fn add(&mut self, entity: u32, component: T);
    fn add_many(&mut self, entities: &Vec<u32>, component: T);
    fn remove(&mut self, entity: u32);
    fn get(&self, entity: u32) -> Option<&T>;
}
Expand description

Component registry definition. Macro exists to generate a component on the fly.

Required Methods§

Source

fn new() -> Self

Source

fn add(&mut self, entity: u32, component: T)

Source

fn add_many(&mut self, entities: &Vec<u32>, component: T)

Source

fn remove(&mut self, entity: u32)

Source

fn get(&self, entity: u32) -> Option<&T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§