Add train generation and builder for blueprints
This commit is contained in:
parent
3ec2d34f65
commit
6ac0cab8d5
7 changed files with 338 additions and 18 deletions
14
examples/train_blueprint.rs
Normal file
14
examples/train_blueprint.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use factorio_blueprint::blueprint::{train::generate_train, BlueprintString};
|
||||
|
||||
fn main() {
|
||||
let b = generate_train(2, 4, true, true);
|
||||
|
||||
let b = BlueprintString::Blueprint(b);
|
||||
|
||||
println!("{}", serde_json::to_string_pretty(&b).unwrap());
|
||||
|
||||
println!(
|
||||
"{}",
|
||||
factorio_blueprint::blueprint::encode(&serde_json::to_string(&b).unwrap())
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue