use beet_core::prelude::*;
pub trait Props {
type Builder: PropsBuilder<Props = Self>;
type Required;
}
pub trait PropsBuilder: Default {
type Props: Props<Builder = Self>;
fn build(self) -> Self::Props;
}
#[derive(Component, Deref)]
#[relationship(relationship_target = TemplateRoot)]
pub struct TemplateOf(Entity);
impl TemplateOf {
pub fn new(value: Entity) -> Self { Self(value) }
}
#[derive(Component)]
#[relationship_target(relationship = TemplateOf,linked_spawn)]
pub struct TemplateRoot(Vec<Entity>);
impl std::ops::Deref for TemplateRoot {
type Target = Entity;
fn deref(&self) -> &Self::Target { &self.0[0] }
}