|
|
@ -1,4 +1,4 @@ |
|
|
|
use gntag::{get_view, get_world, DefaultView};
|
|
|
|
use gntag::{draw_world, get_view, get_world, DefaultView};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let view = get_view();
|
|
|
@ -18,26 +18,7 @@ fn run_simulation(view: &DefaultView) { |
|
|
|
|
|
|
|
let mut gen = 0;
|
|
|
|
loop {
|
|
|
|
let resized = (*view.lock().unwrap())
|
|
|
|
.as_mut()
|
|
|
|
.unwrap()
|
|
|
|
.draw(
|
|
|
|
gen,
|
|
|
|
world
|
|
|
|
.state
|
|
|
|
.agent_positions
|
|
|
|
.get(&world.state.tagged)
|
|
|
|
.map(|pos| (pos.x, pos.y))
|
|
|
|
.unwrap(),
|
|
|
|
world
|
|
|
|
.state
|
|
|
|
.agent_positions
|
|
|
|
.iter()
|
|
|
|
.map(|(_id, pos)| (pos.x, pos.y))
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
.as_ref(),
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
let resized = draw_world(&world, gen, view).unwrap();
|
|
|
|
if resized {
|
|
|
|
return;
|
|
|
|
};
|
|
|
|