Fix missing assembly machine type
This commit is contained in:
parent
48a648716d
commit
f4a6173a9f
3 changed files with 23 additions and 13 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
use factorio_blueprint::abstraction::{Blueprint, ElectricPoleType, Entity, InserterType};
|
use factorio_blueprint::abstraction::{Blueprint, ElectricPoleType, Entity, InserterType};
|
||||||
use factorio_core::{beltoptions::Beltspeed, prelude::*};
|
use factorio_core::{beltoptions::Beltspeed, prelude::*};
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
AAABBBCCC
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
pub fn assembly_line(
|
pub fn assembly_line(
|
||||||
assembly_machines: usize,
|
assembly_machines: usize,
|
||||||
machine: impl AsRef<str>,
|
machine: impl AsRef<str>,
|
||||||
|
|
@ -490,7 +496,7 @@ pub fn assembly_line_2_input(
|
||||||
}
|
}
|
||||||
|
|
||||||
blueprint.add_entity(Entity::new_production(
|
blueprint.add_entity(Entity::new_production(
|
||||||
"assembling-machine-3",
|
machine.as_ref(),
|
||||||
recipe.as_ref(),
|
recipe.as_ref(),
|
||||||
Position::new(-3, 21),
|
Position::new(-3, 21),
|
||||||
Direction::Up,
|
Direction::Up,
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@ use clap::Parser;
|
||||||
use factorio_blueprint::{BlueprintString, encode};
|
use factorio_blueprint::{BlueprintString, encode};
|
||||||
use factorio_blueprint_generator::assembly::assembly_line_2_input;
|
use factorio_blueprint_generator::assembly::assembly_line_2_input;
|
||||||
use factorio_core::beltoptions::Beltspeed;
|
use factorio_core::beltoptions::Beltspeed;
|
||||||
|
use factorio_core::visualize::Visualize;
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
struct Args {
|
struct Args {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
json: bool,
|
json: bool,
|
||||||
assembly_machines: usize,
|
assembly_machines: usize,
|
||||||
|
machine: String,
|
||||||
recipe: String,
|
recipe: String,
|
||||||
output_belt: Beltspeed,
|
output_belt: Beltspeed,
|
||||||
input_belt: Vec<Beltspeed>,
|
input_belt: Vec<Beltspeed>,
|
||||||
|
|
@ -15,17 +17,19 @@ struct Args {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
let b = BlueprintString::Blueprint(
|
let b = assembly_line_2_input(
|
||||||
assembly_line_2_input(
|
|
||||||
args.assembly_machines,
|
args.assembly_machines,
|
||||||
|
args.machine,
|
||||||
args.recipe,
|
args.recipe,
|
||||||
args.input_belt[0],
|
args.input_belt[0],
|
||||||
args.input_belt.get(1).copied(),
|
args.input_belt.get(1).copied(),
|
||||||
args.output_belt,
|
args.output_belt,
|
||||||
)
|
)
|
||||||
.0
|
.0;
|
||||||
.to_blueprint(),
|
|
||||||
);
|
b.print_visualization();
|
||||||
|
|
||||||
|
let b = BlueprintString::Blueprint(b.to_blueprint());
|
||||||
|
|
||||||
if args.json {
|
if args.json {
|
||||||
println!("{}", serde_json::to_string_pretty(&b).unwrap());
|
println!("{}", serde_json::to_string_pretty(&b).unwrap());
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use clap::{Parser, ValueEnum};
|
use clap::Parser;
|
||||||
use factorio_blueprint::{BlueprintString, encode};
|
use factorio_blueprint::{BlueprintString, encode};
|
||||||
use factorio_blueprint_generator::multistation::{StationSpec, multistation};
|
use factorio_blueprint_generator::multistation::{StationSpec, multistation};
|
||||||
use factorio_core::beltoptions::Beltspeed;
|
use factorio_core::beltoptions::Beltspeed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue