world/de: new module for deserialization data structures

The new structures contain only the fields that MinedMap needs.
This commit is contained in:
Matthias Schiffer 2023-01-28 22:29:12 +01:00
parent 8c34f74952
commit 6379472282
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 122 additions and 2 deletions

View file

@ -1,3 +1,20 @@
fn main() {
println!("Hello, world!");
use std::path::PathBuf;
use anyhow::Result;
use clap::Parser;
#[derive(Debug, Parser)]
struct Args {
/// Filename to dump
file: PathBuf,
}
fn main() -> Result<()> {
let args = Args::parse();
minedmap::io::region::from_file(args.file.as_path())?.foreach_chunk(
|coords, value: minedmap::world::de::Chunk| {
println!("Chunk {:?}: {:#?}", coords, value);
},
)
}