Add furnaces to blueprint graph
This commit is contained in:
parent
618d9ca9de
commit
8e4e83e7ff
8 changed files with 81 additions and 49 deletions
|
|
@ -1,7 +1,11 @@
|
|||
use factorio_blueprint::abstraction::{Blueprint, ElectricPoleType, Entity, InserterType};
|
||||
use factorio_core::{beltoptions::Beltspeed, prelude::*};
|
||||
|
||||
pub fn assembly_line(assembly_machines: usize, recipe: impl AsRef<str>) -> Blueprint {
|
||||
pub fn assembly_line(
|
||||
assembly_machines: usize,
|
||||
machine: impl AsRef<str>,
|
||||
recipe: impl AsRef<str>,
|
||||
) -> Blueprint {
|
||||
let mut blueprint = Blueprint::new();
|
||||
let mut last = None;
|
||||
for i in 0..assembly_machines.div_ceil(3) {
|
||||
|
|
@ -26,7 +30,7 @@ pub fn assembly_line(assembly_machines: usize, recipe: impl AsRef<str>) -> Bluep
|
|||
|
||||
for i in 0..assembly_machines {
|
||||
blueprint.add_entity(Entity::new_production(
|
||||
"assembling-machine-3",
|
||||
&machine,
|
||||
recipe.as_ref(),
|
||||
Position::new(3 + 6 * i as PositionType, 9),
|
||||
Direction::Up,
|
||||
|
|
@ -217,6 +221,7 @@ pub fn assembly_line(assembly_machines: usize, recipe: impl AsRef<str>) -> Bluep
|
|||
|
||||
pub fn assembly_line_2_input(
|
||||
assembly_machines: usize,
|
||||
machine: impl AsRef<str>,
|
||||
recipe: impl AsRef<str>,
|
||||
input_belt1: Beltspeed,
|
||||
input_belt2: Option<Beltspeed>,
|
||||
|
|
@ -260,14 +265,14 @@ pub fn assembly_line_2_input(
|
|||
|
||||
for i in 0..halve_machines {
|
||||
blueprint.add_entity(Entity::new_production(
|
||||
"assembling-machine-3",
|
||||
&machine,
|
||||
recipe.as_ref(),
|
||||
Position::new(3 + 6 * i as PositionType, 9),
|
||||
Direction::Up,
|
||||
Position::new(6, 6),
|
||||
));
|
||||
blueprint.add_entity(Entity::new_production(
|
||||
"assembling-machine-3",
|
||||
&machine,
|
||||
recipe.as_ref(),
|
||||
Position::new(3 + 6 * i as PositionType, 21),
|
||||
Direction::Up,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ pub fn generate_factory<L: Layouter, P: Pathfinder + Sync, R: Rng + SeedableRng
|
|||
machines,
|
||||
machine,
|
||||
} => {
|
||||
assert_eq!(machine, "assembly-machine-3");
|
||||
// assert_eq!(machine, "assembly-machine-3");
|
||||
assert_eq!(output_connections.len(), 1);
|
||||
assert!(input_connections.len() <= 3);
|
||||
let output_connection = output_connections.first().unwrap();
|
||||
|
|
@ -224,6 +224,7 @@ pub fn generate_factory<L: Layouter, P: Pathfinder + Sync, R: Rng + SeedableRng
|
|||
|
||||
let (b, size, y_output, y_inputs) = assembly_line_2_input(
|
||||
*machines,
|
||||
machine,
|
||||
recipe,
|
||||
input_belt1,
|
||||
input_belt2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue