Add assembly generation
This commit is contained in:
parent
fec7dd70db
commit
05f4edf83a
4 changed files with 286 additions and 0 deletions
21
factorio-blueprint-generator/src/bin/assembly.rs
Normal file
21
factorio-blueprint-generator/src/bin/assembly.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use clap::Parser;
|
||||
use factorio_blueprint::{BlueprintString, encode};
|
||||
use factorio_blueprint_generator::assembly::assembly_line;
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
#[arg(short, long)]
|
||||
json: bool,
|
||||
assembly_machines: usize,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
let b = BlueprintString::Blueprint(assembly_line(args.assembly_machines).to_blueprint());
|
||||
|
||||
if args.json {
|
||||
println!("{}", serde_json::to_string_pretty(&b).unwrap());
|
||||
}
|
||||
|
||||
println!("{}", encode(&serde_json::to_string(&b).unwrap()));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue