1mod block;
8mod element;
9mod item;
10mod kind;
11mod model;
12mod recipe;
13mod states;
14
15use yog_data::{Atom, Diagnostic, Path};
16
17pub trait Rules {
19 fn rules(&self, _out: &mut Vec<Diagnostic>) {}
21}
22
23fn error(path: Path, message: impl std::fmt::Display) -> Diagnostic {
25 Diagnostic::error(Atom::new(yog_ids::build_problem::CONTENT), message).at_path(path)
26}
27
28fn warning(path: Path, message: impl std::fmt::Display) -> Diagnostic {
30 Diagnostic::warning(Atom::new(yog_ids::build_problem::CONTENT), message).at_path(path)
31}
32
33macro_rules! no_rules {
35 ($($t:ty),* $(,)?) => {$( impl Rules for $t {} )*};
36}
37
38no_rules!(
39 yog_registry::EntityDef,
40 crate::sound::SoundFile,
41 yog_registry::Particle,
42 crate::video::Video,
43 crate::book::Book,
44 crate::def::Def,
45 crate::yres::YresFile,
46 yog_body::format::ModelFile,
47 yog_body::format::AnimFile,
48 yog_font::Font,
49 crate::texture::TextureFile,
50 crate::material::MaterialFile,
51);
52
53#[cfg(test)]
54mod tests;