Improve single station loader

This commit is contained in:
hal8174 2025-04-23 15:34:41 +02:00
parent 59d7cf50cb
commit 7638081f26

View file

@ -134,13 +134,13 @@ pub fn unloader(
pub fn one_loader(beltspeed: Beltspeed, stacked: bool) -> (Blueprint, PositionType) { pub fn one_loader(beltspeed: Beltspeed, stacked: bool) -> (Blueprint, PositionType) {
let (belt_inserter, quality) = match (beltspeed, stacked) { let (belt_inserter, quality) = match (beltspeed, stacked) {
(Beltspeed::Normal, false) => (InserterType::Fast, Quality::Normal), (Beltspeed::Normal, false) => (InserterType::Fast, Quality::Normal),
(Beltspeed::Fast, false) => (InserterType::Bulk, Quality::Uncommon), (Beltspeed::Fast, false) => (InserterType::Fast, Quality::Normal),
(Beltspeed::Express, false) => (InserterType::Bulk, Quality::Rare), (Beltspeed::Express, false) => (InserterType::Bulk, Quality::Normal),
(Beltspeed::Turbo, false) => (InserterType::Bulk, Quality::Legendary), (Beltspeed::Turbo, false) => (InserterType::Bulk, Quality::Rare),
(Beltspeed::Normal, true) => todo!(), (Beltspeed::Normal, true) => (InserterType::Bulk, Quality::Normal),
(Beltspeed::Fast, true) => todo!(), (Beltspeed::Fast, true) => (InserterType::Bulk, Quality::Uncommon),
(Beltspeed::Express, true) => todo!(), (Beltspeed::Express, true) => (InserterType::Bulk, Quality::Rare),
(Beltspeed::Turbo, true) => todo!(), (Beltspeed::Turbo, true) => (InserterType::Stack, Quality::Rare),
}; };
let mut b = Blueprint::new(); let mut b = Blueprint::new();
@ -150,48 +150,37 @@ pub fn one_loader(beltspeed: Beltspeed, stacked: bool) -> (Blueprint, PositionTy
Position::new(8, -9), Position::new(8, -9),
Direction::Down, Direction::Down,
)); ));
b.add_entity(Entity::new_belt(
beltspeed, b.add_entity(Entity::new_splitter(
Position::new(1, 1) + 2 * Position::new(3, -4), beltspeed.halve(),
Direction::Left, Position::new(6, -7),
Direction::Down,
)); ));
b.add_entity(Entity::new_belt( b.add_entity(Entity::new_splitter(
beltspeed, beltspeed.halve(),
Position::new(1, 1) + 2 * Position::new(4, -4), Position::new(10, -7),
Direction::Right, Direction::Down,
)); ));
let mut s = |x, beltdir| { for i in 0..4 {
b.add_entity(Entity::new_belt( let x = 5 + 2 * i;
beltspeed,
Position::new(1, 1) + 2 * Position::new(x, -4),
beltdir,
));
b.add_entity( b.add_entity(
Entity::new_inserter( Entity::new_inserter(belt_inserter, None, Position::new(x, -5), Direction::Up)
belt_inserter,
None,
Position::new(1, 1) + 2 * Position::new(x, -3),
Direction::Up,
)
.quality(quality), .quality(quality),
); );
b.add_entity(Entity::new_unknown( b.add_entity(Entity::new_unknown(
"steel-chest", "steel-chest",
Position::new(1, 1) + 2 * Position::new(x, -2), Position::new(x, -3),
Direction::Up, Direction::Up,
Position::new(2, 2), Position::new(2, 2),
)); ));
b.add_entity(Entity::new_inserter( b.add_entity(Entity::new_inserter(
InserterType::Bulk, InserterType::Bulk,
None, None,
Position::new(1, 1) + 2 * Position::new(x, -1), Position::new(x, -1),
Direction::Up, Direction::Up,
)); ));
}; }
s(2, Direction::Left);
s(5, Direction::Right);
(b, -6) (b, -6)
} }