mindustry logic execution, map- and schematic- parsing and rendering
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use mindus::build_registry;
use mindus::Renderable;
use mindus::SchematicSerializer;
use std::env::Args;

use crate::print_err;

pub fn main(args: Args) {
    let reg = build_registry();
    let mut ss = SchematicSerializer(&reg);

    // process schematics from command line
    for curr in args {
        match ss.deserialize_base64(&curr) {
            Ok(s) => {
                s.render().save("x.png");
            }
            // continue processing literals & maybe interactive mode
            Err(e) => {
                print_err!(e, "Could not read schematic");
            }
        }
    }
}