use crate::{ArchetypeName, ComponentName};
pub trait Enum:
Sized + Copy + Clone + std::hash::Hash + PartialEq + Eq + std::fmt::Display + 'static
{
fn variants() -> &'static [Self];
fn docstring_md(self) -> &'static str;
}
#[derive(Clone, Debug, Default)]
pub struct Reflection {
pub components: ComponentReflectionMap,
pub archetypes: ArchetypeReflectionMap,
}
pub type ComponentReflectionMap = nohash_hasher::IntMap<ComponentName, ComponentReflection>;
#[derive(Clone, Debug)]
pub struct ComponentReflection {
pub docstring_md: &'static str,
pub placeholder: Option<Box<dyn arrow2::array::Array>>,
}
pub type ArchetypeReflectionMap = nohash_hasher::IntMap<ArchetypeName, ArchetypeReflection>;
#[derive(Clone, Debug)]
pub struct ArchetypeReflection {
pub display_name: &'static str,
pub docstring_md: &'static str,
pub fields: Vec<ArchetypeFieldReflection>,
}
#[derive(Clone, Debug)]
pub struct ArchetypeFieldReflection {
pub component_name: ComponentName,
pub display_name: &'static str,
pub docstring_md: &'static str,
}