Refactor common types.
This commit is contained in:
parent
f284b692cc
commit
48419b4674
14 changed files with 376 additions and 250 deletions
|
|
@ -1,20 +1,23 @@
|
|||
use factorio_blueprint::{
|
||||
belt_finding::common::Position,
|
||||
layout::{Layout, Problem},
|
||||
};
|
||||
use factorio_blueprint::layout::Layout;
|
||||
use rand::SeedableRng;
|
||||
|
||||
fn main() {
|
||||
let mut p = Problem::new(Position::new(10, 10));
|
||||
// let mut p = Problem::new(Position::new(10, 10));
|
||||
|
||||
let b1 = p.add_block(Position::new(3, 2));
|
||||
let b2 = p.add_block(Position::new(5, 2));
|
||||
let b3 = p.add_block(Position::new(5, 7));
|
||||
// let b1 = p.add_block(Position::new(3, 2));
|
||||
// let b2 = p.add_block(Position::new(5, 2));
|
||||
// let b3 = p.add_block(Position::new(5, 7));
|
||||
|
||||
p.add_connection(b1, Position::new(0, 0), b2, Position::new(0, 0));
|
||||
p.add_connection(b2, Position::new(3, 1), b3, Position::new(4, 6));
|
||||
// p.add_connection(b1, Position::new(1, 0), b2, Position::new(1, 0));
|
||||
// p.add_connection(b2, Position::new(3, 1), b3, Position::new(4, 6));
|
||||
|
||||
for i in 0..10 {
|
||||
let file = std::fs::File::open("layout.yml").unwrap();
|
||||
|
||||
let p = serde_yaml::from_reader(file).unwrap();
|
||||
|
||||
dbg!(&p);
|
||||
|
||||
for i in 0..1 {
|
||||
let mut rng = rand::rngs::SmallRng::seed_from_u64(i);
|
||||
|
||||
let l = Layout::new(&p, &mut rng);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue