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