Add automatic distribution

This commit is contained in:
hal8174 2025-03-31 23:28:18 +02:00
parent 721e83006d
commit aee56af22f
5 changed files with 386 additions and 14 deletions

View file

@ -1,7 +1,8 @@
use factorio_blueprint::abstraction::{Blueprint, Entity, RailType, UndergroundType};
use factorio_core::{beltoptions::Beltspeed, prelude::*};
use crate::{balancer::binary_balancer, station::basic_station};
use factorio_blueprint::abstraction::{
Blueprint, ElectricPoleType, Entity, RailType, UndergroundType,
};
use factorio_core::{beltoptions::Beltspeed, prelude::*};
pub struct StationSpec {
pub locomotives: usize,
@ -52,6 +53,12 @@ pub fn multistation(
let mut blueprint = Blueprint::new();
// connection power pole
blueprint.add_entity(Entity::new_electric_pole(
ElectricPoleType::Big,
Position::new(32, 0),
));
// stacker
let stacker_length = (longest_train * 5).div_ceil(2);
blueprint.add_entity(Entity::new_rail(