pub mod content;
pub mod def;
pub mod manifest;
pub mod recipe;
pub mod tags;
pub mod yres;
use yog_data::{Schema, Shape};
pub const FORMATS: [&str; 9] = ["yblock", "yitem", "yentity", "yrecipe", "ydef", "yres", "ymodel", "yanim", "yog.toml"];
pub fn shape(name: &str) -> Option<Shape> {
Some(match name {
"yblock" => content::BlockFile::shape(),
"yitem" => content::ItemFile::shape(),
"yrecipe" => recipe::RecipeFile::shape(),
"ydef" => def::Def::shape(),
"yres" => Shape::Map(yres::EntryObject::shape),
"yentity" => yog_registry::EntityDef::shape(),
"ymodel" => yog_body::format::ModelFile::shape(),
"yanim" => yog_body::format::AnimFile::shape(),
"yog.toml" => manifest::ManifestFile::shape(),
_ => return None,
})
}
#[cfg(test)]
mod tests {
#[test]
fn every_format_describes_itself() {
for f in super::FORMATS {
let d = super::shape(f).unwrap().describe();
assert!(d.get("root").is_some(), "{f}");
}
}
}