Add loader station
This commit is contained in:
parent
b715c4ad06
commit
505ca6ff5c
12 changed files with 479 additions and 494 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use factorio_blueprint::{BlueprintBook, BlueprintBookEntry, BlueprintString, encode};
|
use factorio_blueprint::{BlueprintBook, BlueprintBookEntry, BlueprintString, encode};
|
||||||
use factorio_blueprint_generator::station::basic_unload_station;
|
use factorio_blueprint_generator::station::basic_station;
|
||||||
use factorio_core::beltoptions::{Beltspeed, Belttype};
|
use factorio_core::beltoptions::{Beltspeed, Belttype};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
|
@ -13,6 +13,7 @@ struct Args {
|
||||||
enum Command {
|
enum Command {
|
||||||
Book,
|
Book,
|
||||||
Single {
|
Single {
|
||||||
|
load: bool,
|
||||||
locomotives: usize,
|
locomotives: usize,
|
||||||
length: usize,
|
length: usize,
|
||||||
outputs: usize,
|
outputs: usize,
|
||||||
|
|
@ -41,27 +42,31 @@ fn main() {
|
||||||
];
|
];
|
||||||
|
|
||||||
for (i, (locomotives, cargo)) in layouts.into_iter().enumerate() {
|
for (i, (locomotives, cargo)) in layouts.into_iter().enumerate() {
|
||||||
let mut inner_b = Vec::new();
|
for load in [false, true] {
|
||||||
|
let mut inner_b = Vec::new();
|
||||||
|
|
||||||
let mut j = 0;
|
for (j, beltspeed) in [
|
||||||
for beltspeed in [
|
Beltspeed::Normal,
|
||||||
Beltspeed::Normal,
|
Beltspeed::Fast,
|
||||||
Beltspeed::Fast,
|
Beltspeed::Express,
|
||||||
Beltspeed::Express,
|
Beltspeed::Turbo,
|
||||||
Beltspeed::Turbo,
|
]
|
||||||
] {
|
.into_iter()
|
||||||
let belttypes: &[_] = match beltspeed {
|
.enumerate()
|
||||||
Beltspeed::Normal => &[Belttype::Full, Belttype::Left, Belttype::Right],
|
{
|
||||||
_ => &[Belttype::Full],
|
|
||||||
};
|
|
||||||
for &belttype in belttypes {
|
|
||||||
let mut inner_inner_b = Vec::new();
|
let mut inner_inner_b = Vec::new();
|
||||||
|
|
||||||
for (l, o) in (0..=(cargo as u32).ilog2()).enumerate() {
|
for (l, o) in (0..=(cargo as u32).ilog2()).enumerate() {
|
||||||
let o = 1 << o;
|
let o = 1 << o;
|
||||||
|
|
||||||
let blueprint =
|
let blueprint = basic_station(
|
||||||
basic_unload_station(locomotives, cargo, o, beltspeed, belttype);
|
load,
|
||||||
|
locomotives,
|
||||||
|
cargo,
|
||||||
|
o,
|
||||||
|
beltspeed,
|
||||||
|
Belttype::Full,
|
||||||
|
);
|
||||||
|
|
||||||
inner_inner_b.push(BlueprintBookEntry::new(
|
inner_inner_b.push(BlueprintBookEntry::new(
|
||||||
BlueprintString::Blueprint(blueprint),
|
BlueprintString::Blueprint(blueprint),
|
||||||
|
|
@ -74,25 +79,27 @@ fn main() {
|
||||||
BlueprintBook::builder()
|
BlueprintBook::builder()
|
||||||
.blueprints(inner_inner_b)
|
.blueprints(inner_inner_b)
|
||||||
.active_index(0)
|
.active_index(0)
|
||||||
.label(format!("{:?}-{:?}", beltspeed, belttype))
|
.label(format!("{:?}", beltspeed))
|
||||||
.build(),
|
.build(),
|
||||||
),
|
),
|
||||||
j,
|
j as u32,
|
||||||
));
|
));
|
||||||
j += 1;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
b.push(BlueprintBookEntry::new(
|
b.push(BlueprintBookEntry::new(
|
||||||
BlueprintString::BlueprintBook(
|
BlueprintString::BlueprintBook(
|
||||||
BlueprintBook::builder()
|
BlueprintBook::builder()
|
||||||
.blueprints(inner_b)
|
.blueprints(inner_b)
|
||||||
.active_index(0)
|
.active_index(0)
|
||||||
.label(format!("{locomotives}-{cargo}"))
|
.label(format!("{locomotives}-{cargo}-{}", match load {
|
||||||
.build(),
|
true => "load",
|
||||||
),
|
false => "unload",
|
||||||
i as u32,
|
}))
|
||||||
));
|
.build(),
|
||||||
|
),
|
||||||
|
2 * i as u32 + load as u32,
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let b = BlueprintString::BlueprintBook(
|
let b = BlueprintString::BlueprintBook(
|
||||||
|
|
@ -105,13 +112,15 @@ fn main() {
|
||||||
println!("{}", encode(&serde_json::to_string(&b).unwrap()));
|
println!("{}", encode(&serde_json::to_string(&b).unwrap()));
|
||||||
}
|
}
|
||||||
Command::Single {
|
Command::Single {
|
||||||
|
load,
|
||||||
locomotives,
|
locomotives,
|
||||||
length,
|
length,
|
||||||
outputs,
|
outputs,
|
||||||
beltspeed,
|
beltspeed,
|
||||||
belttype,
|
belttype,
|
||||||
} => {
|
} => {
|
||||||
let b = BlueprintString::Blueprint(basic_unload_station(
|
let b = BlueprintString::Blueprint(basic_station(
|
||||||
|
load,
|
||||||
locomotives,
|
locomotives,
|
||||||
length,
|
length,
|
||||||
outputs,
|
outputs,
|
||||||
|
|
|
||||||
122
factorio-blueprint-generator/src/binary_merger.rs
Normal file
122
factorio-blueprint-generator/src/binary_merger.rs
Normal file
|
|
@ -0,0 +1,122 @@
|
||||||
|
use factorio_blueprint::{BlueprintEntity, BlueprintPosition};
|
||||||
|
use factorio_core::beltoptions::Beltspeed;
|
||||||
|
|
||||||
|
pub fn merger(
|
||||||
|
reverse: bool,
|
||||||
|
beltspeed: Beltspeed,
|
||||||
|
offset_x: f64,
|
||||||
|
offset_y: f64,
|
||||||
|
outer_offset: u32,
|
||||||
|
intervall: usize,
|
||||||
|
outputs: usize,
|
||||||
|
lines: usize,
|
||||||
|
) -> Vec<BlueprintEntity> {
|
||||||
|
let section_size = lines / outputs;
|
||||||
|
assert!(lines % outputs == 0);
|
||||||
|
assert!(section_size.is_power_of_two());
|
||||||
|
assert!(outputs <= lines);
|
||||||
|
|
||||||
|
let flip = match reverse {
|
||||||
|
true => 8,
|
||||||
|
false => 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut e = Vec::new();
|
||||||
|
|
||||||
|
// output and merging
|
||||||
|
for o in 0..outputs {
|
||||||
|
// stubs
|
||||||
|
let stubspeed = beltspeed.halvings(section_size.ilog2() as usize);
|
||||||
|
for i in 0..section_size {
|
||||||
|
let depth = o + i.count_ones() as usize;
|
||||||
|
|
||||||
|
for j in 0..depth {
|
||||||
|
let offset = outer_offset + e.len() as u32;
|
||||||
|
e.push(
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
stubspeed.string(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(
|
||||||
|
(intervall * (i + o * section_size)) as f64 + offset_x,
|
||||||
|
offset_y - j as f64,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.direction(flip)
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let offset = outer_offset + e.len() as u32;
|
||||||
|
e.push(
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
stubspeed.string(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(
|
||||||
|
(intervall * (i + o * section_size)) as f64 + offset_x,
|
||||||
|
offset_y - depth as f64,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.direction(match reverse {
|
||||||
|
true => 8,
|
||||||
|
false => 12,
|
||||||
|
})
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// merger
|
||||||
|
for i in 1..(section_size.ilog2() as usize + 1) {
|
||||||
|
let p = 1 << i;
|
||||||
|
let mergespeed = beltspeed.halvings((section_size.ilog2() as usize) - i);
|
||||||
|
for j in 0..(section_size / p) {
|
||||||
|
let depth = o + j.count_ones() as usize;
|
||||||
|
let offset = outer_offset + e.len() as u32;
|
||||||
|
e.push(
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
mergespeed.string_splitter(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(
|
||||||
|
(intervall * (j * p + o * section_size)) as f64 - i as f64 + offset_x,
|
||||||
|
offset_y - i as f64 + 0.5 - depth as f64,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.direction(12 - flip)
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
|
e.extend((0..(7 * p / 2)).map(|l| {
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
mergespeed.halve().string(),
|
||||||
|
offset + 1 + l as u32,
|
||||||
|
BlueprintPosition::new(
|
||||||
|
(intervall * (j * p + o * section_size)) as f64 - i as f64
|
||||||
|
+ offset_x
|
||||||
|
+ l as f64
|
||||||
|
+ 1.0,
|
||||||
|
offset_y - i as f64 - depth as f64,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.direction(12 - flip)
|
||||||
|
.build()
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// connect
|
||||||
|
let offset = outer_offset + e.len() as u32;
|
||||||
|
let step = o + section_size.ilog2() as usize;
|
||||||
|
e.extend((0..(7 * o * section_size)).map(|l| {
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string(),
|
||||||
|
offset + l as u32,
|
||||||
|
BlueprintPosition::new(
|
||||||
|
l as f64 + offset_x - section_size.ilog2() as f64,
|
||||||
|
offset_y - step as f64,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.direction(12 - flip)
|
||||||
|
.build()
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
e
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
pub mod balancer;
|
pub mod balancer;
|
||||||
|
pub mod binary_merger;
|
||||||
pub mod station;
|
pub mod station;
|
||||||
pub mod train;
|
pub mod train;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,295 @@
|
||||||
use factorio_blueprint::{Blueprint, BlueprintEntity, BlueprintPosition};
|
use factorio_blueprint::{Blueprint, BlueprintEntity, BlueprintPosition};
|
||||||
use factorio_core::beltoptions::{Beltspeed, Belttype};
|
use factorio_core::beltoptions::{Beltspeed, Belttype};
|
||||||
|
|
||||||
pub fn station_unload(
|
use crate::binary_merger::merger;
|
||||||
length: usize,
|
|
||||||
|
pub fn unloader(beltspeed: Beltspeed, belttype: Belttype) -> (Vec<BlueprintEntity>, f64) {
|
||||||
|
if beltspeed == Beltspeed::Normal {
|
||||||
|
let mut e = vec![
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"fast-transport-belt".to_owned(),
|
||||||
|
0,
|
||||||
|
BlueprintPosition::new(3.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
];
|
||||||
|
|
||||||
|
if belttype.contains_left() {
|
||||||
|
let offset = e.len() as u32;
|
||||||
|
e.extend_from_slice(&[
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(5.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 1,
|
||||||
|
BlueprintPosition::new(5.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"fast-inserter".to_owned(),
|
||||||
|
offset + 2,
|
||||||
|
BlueprintPosition::new(4.5, -1.5),
|
||||||
|
)
|
||||||
|
.direction(4)
|
||||||
|
.build(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if belttype.contains_right() {
|
||||||
|
let offset = e.len() as u32;
|
||||||
|
e.extend_from_slice(&[
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(1.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 1,
|
||||||
|
BlueprintPosition::new(1.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"fast-inserter".to_owned(),
|
||||||
|
offset + 2,
|
||||||
|
BlueprintPosition::new(2.5, -1.5),
|
||||||
|
)
|
||||||
|
.direction(12)
|
||||||
|
.build(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
(e, -2.5)
|
||||||
|
} else {
|
||||||
|
let (belt_inserter, stack_size, quality) = match beltspeed {
|
||||||
|
Beltspeed::Normal => unreachable!(),
|
||||||
|
Beltspeed::Fast => ("fast-inserter", None, None),
|
||||||
|
Beltspeed::Express => ("bulk-inserter", Some(8), None),
|
||||||
|
Beltspeed::Turbo => ("fast-inserter", None, Some(String::from("epic"))),
|
||||||
|
};
|
||||||
|
let mut e = vec![
|
||||||
|
BlueprintEntity::builder(beltspeed.string(), 0, BlueprintPosition::new(3.5, -3.5))
|
||||||
|
.build(),
|
||||||
|
];
|
||||||
|
|
||||||
|
if belttype.contains_left() {
|
||||||
|
let offset = e.len() as u32;
|
||||||
|
e.extend_from_slice(&[
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(1.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 1,
|
||||||
|
BlueprintPosition::new(1.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
offset + 2,
|
||||||
|
BlueprintPosition::new(1.5, -2.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.maybe_override_stack_size(stack_size)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string(),
|
||||||
|
offset + 3,
|
||||||
|
BlueprintPosition::new(1.5, -3.5),
|
||||||
|
)
|
||||||
|
.direction(4)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset + 4,
|
||||||
|
BlueprintPosition::new(2.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 5,
|
||||||
|
BlueprintPosition::new(2.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
offset + 6,
|
||||||
|
BlueprintPosition::new(2.5, -2.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.maybe_override_stack_size(stack_size)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string(),
|
||||||
|
offset + 7,
|
||||||
|
BlueprintPosition::new(2.5, -3.5),
|
||||||
|
)
|
||||||
|
.direction(4)
|
||||||
|
.build(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if belttype.contains_right() {
|
||||||
|
let offset = e.len() as u32;
|
||||||
|
e.extend_from_slice(&[
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset,
|
||||||
|
BlueprintPosition::new(4.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 1,
|
||||||
|
BlueprintPosition::new(4.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
offset + 2,
|
||||||
|
BlueprintPosition::new(4.5, -2.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.maybe_override_stack_size(stack_size)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string(),
|
||||||
|
offset + 3,
|
||||||
|
BlueprintPosition::new(4.5, -3.5),
|
||||||
|
)
|
||||||
|
.direction(12)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
offset + 4,
|
||||||
|
BlueprintPosition::new(5.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
offset + 5,
|
||||||
|
BlueprintPosition::new(5.5, -0.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
offset + 6,
|
||||||
|
BlueprintPosition::new(5.5, -2.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.maybe_override_stack_size(stack_size)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string(),
|
||||||
|
offset + 7,
|
||||||
|
BlueprintPosition::new(5.5, -3.5),
|
||||||
|
)
|
||||||
|
.direction(12)
|
||||||
|
.build(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
(e, -4.5)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn one_loader(beltspeed: Beltspeed) -> (Vec<BlueprintEntity>, f64) {
|
||||||
|
let (belt_inserter, quality) = match beltspeed {
|
||||||
|
Beltspeed::Normal => ("fast-inserter", None),
|
||||||
|
Beltspeed::Fast => ("bulk-inserter", Some(String::from("uncommon"))),
|
||||||
|
Beltspeed::Express => ("bulk-inserter", Some(String::from("rare"))),
|
||||||
|
Beltspeed::Turbo => ("bulk-inserter", Some(String::from("legendary"))),
|
||||||
|
};
|
||||||
|
|
||||||
|
(
|
||||||
|
vec![
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
beltspeed.string_splitter(),
|
||||||
|
0,
|
||||||
|
BlueprintPosition::new(4.0, -4.5),
|
||||||
|
)
|
||||||
|
.direction(8)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(beltspeed.string(), 1, BlueprintPosition::new(2.5, -3.5))
|
||||||
|
.direction(12)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(beltspeed.string(), 2, BlueprintPosition::new(3.5, -3.5))
|
||||||
|
.direction(12)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(beltspeed.string(), 3, BlueprintPosition::new(4.5, -3.5))
|
||||||
|
.direction(4)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(beltspeed.string(), 4, BlueprintPosition::new(5.5, -3.5))
|
||||||
|
.direction(4)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
5,
|
||||||
|
BlueprintPosition::new(2.5, -2.5),
|
||||||
|
)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
belt_inserter.to_owned(),
|
||||||
|
6,
|
||||||
|
BlueprintPosition::new(5.5, -2.5),
|
||||||
|
)
|
||||||
|
.maybe_quality(quality.clone())
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
7,
|
||||||
|
BlueprintPosition::new(2.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"steel-chest".to_owned(),
|
||||||
|
8,
|
||||||
|
BlueprintPosition::new(5.5, -1.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
9,
|
||||||
|
BlueprintPosition::new(2.5, -0.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
BlueprintEntity::builder(
|
||||||
|
"bulk-inserter".to_owned(),
|
||||||
|
10,
|
||||||
|
BlueprintPosition::new(5.5, -0.5),
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
|
],
|
||||||
|
-5.5,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn basic_station(
|
||||||
|
load: bool,
|
||||||
locomotives: usize,
|
locomotives: usize,
|
||||||
unloader: &[BlueprintEntity],
|
length: usize,
|
||||||
beltspeed: Beltspeed,
|
|
||||||
outputs: usize,
|
outputs: usize,
|
||||||
output_x: f64,
|
beltspeed: Beltspeed,
|
||||||
output_y: f64,
|
belttype: Belttype,
|
||||||
) -> Blueprint {
|
) -> Blueprint {
|
||||||
let section_size = length / outputs;
|
let section_size = length / outputs;
|
||||||
assert!(length % outputs == 0);
|
assert!(length % outputs == 0);
|
||||||
|
|
@ -32,6 +313,14 @@ pub fn station_unload(
|
||||||
}
|
}
|
||||||
|
|
||||||
// unloader
|
// unloader
|
||||||
|
let (unloader, output_y) = match load {
|
||||||
|
false => unloader(
|
||||||
|
beltspeed.halvings((length / outputs).ilog2() as usize),
|
||||||
|
belttype,
|
||||||
|
),
|
||||||
|
true => one_loader(beltspeed.halvings((length / outputs).ilog2() as usize)),
|
||||||
|
};
|
||||||
|
|
||||||
let offset = e.len();
|
let offset = e.len();
|
||||||
for l in 0..length {
|
for l in 0..length {
|
||||||
e.extend(unloader.iter().cloned().map(|mut e| {
|
e.extend(unloader.iter().cloned().map(|mut e| {
|
||||||
|
|
@ -68,96 +357,16 @@ pub fn station_unload(
|
||||||
}
|
}
|
||||||
|
|
||||||
// output and merging
|
// output and merging
|
||||||
for o in 0..outputs {
|
e.extend(merger(
|
||||||
// stubs
|
load,
|
||||||
let stubspeed = beltspeed.halvings(section_size.ilog2() as usize);
|
beltspeed,
|
||||||
for i in 0..section_size {
|
global_x_offset as f64 + 3.5,
|
||||||
let depth = o + i.count_ones() as usize;
|
output_y,
|
||||||
|
e.len() as u32,
|
||||||
for j in 0..depth {
|
7,
|
||||||
let offset = e.len() as u32;
|
outputs,
|
||||||
e.push(
|
length,
|
||||||
BlueprintEntity::builder(
|
));
|
||||||
stubspeed.string(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(
|
|
||||||
(7 * (i + o * section_size) + global_x_offset) as f64 + output_x,
|
|
||||||
output_y - j as f64,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.push(
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
stubspeed.string(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(
|
|
||||||
(7 * (i + o * section_size) + global_x_offset) as f64 + output_x,
|
|
||||||
output_y - depth as f64,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// merger
|
|
||||||
for i in 1..(section_size.ilog2() as usize + 1) {
|
|
||||||
let p = 1 << i;
|
|
||||||
let mergespeed = beltspeed.halvings((section_size.ilog2() as usize) - i);
|
|
||||||
for j in 0..(section_size / p) {
|
|
||||||
let depth = o + j.count_ones() as usize;
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.push(
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
mergespeed.string_splitter(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(
|
|
||||||
(7 * (j * p + o * section_size) + global_x_offset) as f64 - i as f64
|
|
||||||
+ output_x,
|
|
||||||
output_y - i as f64 + 0.5 - depth as f64,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
);
|
|
||||||
e.extend((0..(7 * p / 2)).map(|l| {
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
mergespeed.halve().string(),
|
|
||||||
offset + 1 + l as u32,
|
|
||||||
BlueprintPosition::new(
|
|
||||||
(7 * (j * p + o * section_size) + global_x_offset) as f64 - i as f64
|
|
||||||
+ output_x
|
|
||||||
+ l as f64
|
|
||||||
+ 1.0,
|
|
||||||
output_y - i as f64 - depth as f64,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build()
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// connect
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
let step = o + section_size.ilog2() as usize;
|
|
||||||
e.extend((0..(7 * o * section_size)).map(|l| {
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
beltspeed.string(),
|
|
||||||
offset + l as u32,
|
|
||||||
BlueprintPosition::new(
|
|
||||||
(l + global_x_offset) as f64 + output_x - section_size.ilog2() as f64,
|
|
||||||
output_y - step as f64,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build()
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
Blueprint::builder()
|
Blueprint::builder()
|
||||||
.label("station".to_owned())
|
.label("station".to_owned())
|
||||||
|
|
@ -169,363 +378,3 @@ pub fn station_unload(
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unloader(beltspeed: Beltspeed, belttype: Belttype) -> (Vec<BlueprintEntity>, f64) {
|
|
||||||
match beltspeed {
|
|
||||||
Beltspeed::Normal => {
|
|
||||||
let mut e = vec![
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
0,
|
|
||||||
BlueprintPosition::new(3.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
];
|
|
||||||
|
|
||||||
if belttype.contains_left() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(5.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(5.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(4.5, -1.5),
|
|
||||||
)
|
|
||||||
.direction(4)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if belttype.contains_right() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(1.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(1.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(2.5, -1.5),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
(e, -2.5)
|
|
||||||
}
|
|
||||||
Beltspeed::Fast => {
|
|
||||||
let mut e = vec![
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
0,
|
|
||||||
BlueprintPosition::new(3.5, -3.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
];
|
|
||||||
|
|
||||||
if belttype.contains_left() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(1.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(1.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(1.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
offset + 3,
|
|
||||||
BlueprintPosition::new(1.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(4)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset + 4,
|
|
||||||
BlueprintPosition::new(2.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 5,
|
|
||||||
BlueprintPosition::new(2.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 6,
|
|
||||||
BlueprintPosition::new(2.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
offset + 7,
|
|
||||||
BlueprintPosition::new(2.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(4)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if belttype.contains_right() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(4.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(4.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(4.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
offset + 3,
|
|
||||||
BlueprintPosition::new(4.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset + 4,
|
|
||||||
BlueprintPosition::new(5.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 5,
|
|
||||||
BlueprintPosition::new(5.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-inserter".to_owned(),
|
|
||||||
offset + 6,
|
|
||||||
BlueprintPosition::new(5.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"fast-transport-belt".to_owned(),
|
|
||||||
offset + 7,
|
|
||||||
BlueprintPosition::new(5.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
(e, -4.5)
|
|
||||||
}
|
|
||||||
Beltspeed::Express => {
|
|
||||||
let mut e = vec![
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"express-transport-belt".to_owned(),
|
|
||||||
0,
|
|
||||||
BlueprintPosition::new(3.5, -3.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
];
|
|
||||||
|
|
||||||
if belttype.contains_left() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(1.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(1.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(1.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.override_stack_size(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"express-transport-belt".to_owned(),
|
|
||||||
offset + 3,
|
|
||||||
BlueprintPosition::new(1.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(4)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset + 4,
|
|
||||||
BlueprintPosition::new(2.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 5,
|
|
||||||
BlueprintPosition::new(2.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 6,
|
|
||||||
BlueprintPosition::new(2.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.override_stack_size(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"express-transport-belt".to_owned(),
|
|
||||||
offset + 7,
|
|
||||||
BlueprintPosition::new(2.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(4)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if belttype.contains_right() {
|
|
||||||
let offset = e.len() as u32;
|
|
||||||
e.extend_from_slice(&[
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset,
|
|
||||||
BlueprintPosition::new(4.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 1,
|
|
||||||
BlueprintPosition::new(4.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 2,
|
|
||||||
BlueprintPosition::new(4.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.override_stack_size(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"express-transport-belt".to_owned(),
|
|
||||||
offset + 3,
|
|
||||||
BlueprintPosition::new(4.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"steel-chest".to_owned(),
|
|
||||||
offset + 4,
|
|
||||||
BlueprintPosition::new(5.5, -1.5),
|
|
||||||
)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 5,
|
|
||||||
BlueprintPosition::new(5.5, -0.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"bulk-inserter".to_owned(),
|
|
||||||
offset + 6,
|
|
||||||
BlueprintPosition::new(5.5, -2.5),
|
|
||||||
)
|
|
||||||
.direction(8)
|
|
||||||
.override_stack_size(8)
|
|
||||||
.build(),
|
|
||||||
BlueprintEntity::builder(
|
|
||||||
"express-transport-belt".to_owned(),
|
|
||||||
offset + 7,
|
|
||||||
BlueprintPosition::new(5.5, -3.5),
|
|
||||||
)
|
|
||||||
.direction(12)
|
|
||||||
.build(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
(e, -4.5)
|
|
||||||
}
|
|
||||||
Beltspeed::Turbo => (Vec::new(), -4.5),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn basic_unload_station(
|
|
||||||
locomotives: usize,
|
|
||||||
length: usize,
|
|
||||||
outputs: usize,
|
|
||||||
beltspeed: Beltspeed,
|
|
||||||
belttype: Belttype,
|
|
||||||
) -> Blueprint {
|
|
||||||
let (unloader, output_y) = unloader(
|
|
||||||
beltspeed.halvings((length / outputs).ilog2() as usize),
|
|
||||||
belttype,
|
|
||||||
);
|
|
||||||
station_unload(
|
|
||||||
length,
|
|
||||||
locomotives,
|
|
||||||
&unloader,
|
|
||||||
beltspeed,
|
|
||||||
outputs,
|
|
||||||
3.5,
|
|
||||||
output_y,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
0eNqdkMsKgzAQRf9l1qPUaFrMr4gUH0MZMIkksa1I/r3RLroodFFmc+d15jIb9NNCs2MTQG3AgzUeVLOB55vppr1mOk2gQNPIi85ooiE4HrLZTgQRgc1IT1BFbBHIBA5Mb8KRrFez6J5cGsCfJITZ+rRszX4zAS8ilwgrqKyoTrmMEb+Q4n9kWe7IZPnB7vDbFCj2aDEpmZRsU5cD6YT//AjhTs4fSHkWdVXXUlZS1GUR4wvMGmsM
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
0eNqd0M0KgzAMAOB3yTnKWu2GfRWR4U8YgbZKrdtE+u6r7rDDYIfdkib5ErpBZxaaPLsAegPuRzeDrjeY+eZas7+51hJosDTwYjMy1AfPfTaNhiAisBvoCVrEBoFc4MD0Fo5kvbrFduRTA/6UEKZxTsOj23cm8CJzhbCCzkR5ylWM+EXK/8mi2Ml08oP9cW8tUKBE0WCKVIpUk6ocyCb+80cId/LzQaqzrMqqUqpUsipEjC/LnmsK
|
||||||
1
factorio-blueprint/blueprints/inserter-quality.bp
Normal file
1
factorio-blueprint/blueprints/inserter-quality.bp
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0eNqtkLEOwjAMRP/Fc4pIIUDyKwhVoTXIonUhSRFQ5d8xMDAgJAZG2+e7pxth2w54DMQJ3AhU9xzBrUeItGffPnbsOwQHOx9TQRwxJAyg4DT4ltJVLsEHhKyAuMELOJ03CpATJcKX13O4Vjx0W3l1Wn3zPPZRvnp+xIpToacTo0AyiqWdGIloKGD9Uqw+EBT0ZwyBGqxi8vWhinSTlFlWHwjl7wj6LwhSCSXsRPfuW4Fo49PJLEo7t9aYuSntTOd8Bwiih1s=
|
||||||
1
factorio-blueprint/blueprints/rail-curve.bp
Normal file
1
factorio-blueprint/blueprints/rail-curve.bp
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0eNqN0UsKgzAQBuC7zDqCUaMmVyml+BjKgMYSo1Qkd2/USmnrwuU8/m8xM0PZDPgwpC2oGajqdA/qMkNPd100S08XLYICU1ADjgHpGp+guLsyQG3JEm6JtZhuemhLNH6B7clqMCPWwQIEBTB4dL1PdXrBvSRyyWACFfAw9X5NBqttzEPH/tzo0C2P3Gx3+Qk3Pu/GmyuzbzY5UJPTV8jytyp+VX9osth64/MrBiOafl0QaSQTKYVIRCRj7twLWaaXjg==
|
||||||
1
factorio-blueprint/blueprints/rail-diagonal.bp
Normal file
1
factorio-blueprint/blueprints/rail-diagonal.bp
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0eNpFjtEKgzAMRf/lPleYzg7aXxljVA0uoFHaOibSf19Vxh6T3HNyNzTDQrNnibAbuJ0kwN43BO7FDftO3Eiw8I4HJAWWjj6wZXookESOTCdxDOtTlrEhnwPqR4aY2f4Vi0OhME8hU5Ps8mzSplZYYQtzyfqOPbXntdpfcKQxO/4tFd7kwxHQt8rUxmhd68pcy5S+PTBDgg==
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
use base64::Engine;
|
use base64::{Engine, engine::general_purpose::STANDARD, prelude::BASE64_STANDARD};
|
||||||
use base64::engine::general_purpose::STANDARD;
|
use std::io::{Cursor, Read};
|
||||||
use base64::prelude::BASE64_STANDARD;
|
|
||||||
use std::io::Cursor;
|
|
||||||
use std::io::Read;
|
|
||||||
|
|
||||||
pub mod belt;
|
pub mod belt;
|
||||||
pub mod structs;
|
pub mod structs;
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,8 @@ pub struct BlueprintEntity {
|
||||||
switch_state: Option<bool>,
|
switch_state: Option<bool>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
tags: Option<serde_json::Value>,
|
tags: Option<serde_json::Value>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
quality: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
use factorio_blueprint::{encode, misc::Beltspeed, Blueprint, BlueprintString};
|
use factorio_blueprint::{encode, Blueprint, BlueprintString};
|
||||||
use factorio_core::visualize::Visualize;
|
use factorio_core::{beltoptions::Beltspeed, visualize::Visualize};
|
||||||
use factorio_pathfinding::belt_finding::{
|
use factorio_pathfinding::belt_finding::{
|
||||||
conflict_avoidance::ConflictAvoidance, problems, Problem,
|
conflict_avoidance::ConflictAvoidance, problems, Problem,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue