tek/crates/tek_core/src/component/layered.rs
2024-09-05 13:28:05 +03:00

20 lines
482 B
Rust

use crate::*;
pub struct Layered<'a, E: Engine>(pub Collection<'a, E>);
impl<'a, E: Engine> Layered<'a, E> {
pub fn new () -> Self {
Self(Collection::new())
}
}
impl<'a, E: Engine> Collect<'a, E> for Layered<'a, E> {
fn add_box (mut self, item: Box<dyn Render<E> + 'a>) -> Self {
self.0 = self.0.add_box(item);
self
}
fn add_ref (mut self, item: &'a dyn Render<E>) -> Self {
self.0 = self.0.add_ref(item);
self
}
}