diff --git a/factorio-blueprint-generator/src/bin/multistation.rs b/factorio-blueprint-generator/src/bin/multistation.rs index 1ce6b78..d6c6713 100644 --- a/factorio-blueprint-generator/src/bin/multistation.rs +++ b/factorio-blueprint-generator/src/bin/multistation.rs @@ -9,7 +9,7 @@ struct Args { #[arg(short, long)] json: bool, stacker_size: usize, - /// format: -[lu][nfet] + /// format: -[lu][nfet][lr]? stations: Vec, } @@ -26,7 +26,13 @@ fn main() { let (load, s) = s.split_at_checked(1).expect("extracting direction"); - let (beltspeed, lanes) = s.split_at_checked(1).expect("extracting lanes"); + let (beltspeed, s) = s.split_at_checked(1).expect("extracting lanes"); + + let (lanes, belttype) = if s.ends_with(['l', 'r']) { + s.split_at(s.len() - 1) + } else { + (s, "") + }; StationSpec { locomotives: locomotives.parse().expect("parsing locomotive count"), @@ -44,6 +50,12 @@ fn main() { _ => panic!("unknown belt speed {beltspeed}"), }, lanes: lanes.parse().expect("parsing lane count"), + belttype: match belttype { + "" => factorio_core::beltoptions::Belttype::Full, + "r" => factorio_core::beltoptions::Belttype::Right, + "l" => factorio_core::beltoptions::Belttype::Left, + _ => panic!("unknown belttype {belttype}"), + }, } }) .collect::>(); diff --git a/factorio-blueprint-generator/src/factory.rs b/factorio-blueprint-generator/src/factory.rs index 77919b5..47d0476 100644 --- a/factorio-blueprint-generator/src/factory.rs +++ b/factorio-blueprint-generator/src/factory.rs @@ -1,6 +1,6 @@ use crate::{ multistation::{StationSpec, multistation}, - subfactory::{BeltConnection, SubFactory, assembling_line::assembly_line_2_input}, + subfactory::{BeltConnection, SubFactory}, }; use factorio_blueprint::abstraction::{Blueprint, Entity}; use factorio_core::{beltoptions::Beltspeed, prelude::*, visualize::Visualize}; @@ -412,6 +412,7 @@ pub fn generate_factory