use brdb::{BrFsReader, Brdb, Brick, Entity, IntoReader, World};
use std::path::PathBuf;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = PathBuf::from("./example_entity.brdb");
let db = Brdb::new(&path)?.into_reader();
let mut world = World::new();
world.meta.bundle.description = "Example World".to_string();
world.add_brick_grid(
Entity {
frozen: true,
location: (0.0, 0.0, 40.0).into(),
..Default::default()
},
[Brick {
position: (0, 0, 3).into(),
color: (0, 255, 0).into(),
..Default::default()
}],
);
db.save("example world", &world)?;
println!("{}", db.get_fs()?.render());
Ok(())
}