gntag/src/lib.rs
2021-07-23 15:13:41 +02:00

16 lines
472 B
Rust

pub mod agent;
pub mod view;
pub mod world;
use agent::{Agent, SimpleAgent};
use world::ActualWorld;
pub fn get_world(width: isize, height: isize, spacing: usize, validating: bool) -> ActualWorld {
let mut agents: Vec<(_, Box<dyn Agent>)> = vec![];
for x in (0..width).step_by(spacing) {
for y in (0..height).step_by(spacing) {
agents.push(((x, y).into(), Box::new(SimpleAgent)));
}
}
ActualWorld::new((width, height).into(), agents, validating)
}