mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-06 23:59:07 +02:00
world/de: new module for deserialization data structures
The new structures contain only the fields that MinedMap needs.
This commit is contained in:
parent
8c34f74952
commit
6379472282
4 changed files with 122 additions and 2 deletions
21
src/main.rs
21
src/main.rs
|
@ -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);
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue