Start implementing direct serialization for abstract blueprint
This commit is contained in:
parent
8e4e83e7ff
commit
5be9f81205
4 changed files with 109 additions and 4 deletions
|
|
@ -133,11 +133,15 @@ where
|
|||
|
||||
b.print_visualization();
|
||||
|
||||
let b = BlueprintString::Blueprint(b.to_blueprint());
|
||||
let bs = BlueprintString::Blueprint(b.to_blueprint());
|
||||
|
||||
if args.json {
|
||||
println!("{}", serde_json::to_string_pretty(&b).unwrap());
|
||||
println!("{}", serde_json::to_string_pretty(&bs).unwrap());
|
||||
}
|
||||
|
||||
let _ = std::fs::write("out.bp", encode(&serde_json::to_string(&b).unwrap()));
|
||||
let _ = std::fs::write("out.bp", encode(&serde_json::to_string(&bs).unwrap()));
|
||||
|
||||
let bs2 = factorio_blueprint::abstraction::serde::AbstractBlueprintString { blueprint: &b };
|
||||
|
||||
let _ = std::fs::write("out2.bp", encode(&serde_json::to_string(&bs2).unwrap()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue