add vec gloval_it and push in this

This commit is contained in:
lemon-cat committed 2026-05-27 11:22:25 +03:00
1 parent 93b0c65fed
commit 60bd764bcf
2 files changed
+15 -2

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@
#[derive(Clone)]
pub enum Intention {
MoveTo,
StakedOut,
MoveTo((i32, i32)),
StakedOut((i32, i32)),
}
#[derive(Clone)]
+13
View File
@@ -86,5 +86,18 @@ impl World {
}
}
}
let mut global_it: Vec<LinkIntention<Intention>> = Vec::new();
for i in 0..self.agents.len() {
if let Some(ag) = self.agents.get(i) {
global_it.push(LinkIntention {
it: Intention::MoveTo(ag.wolk_a()),
lin: i,
});
global_it.push(LinkIntention {
it: Intention::StakedOut(ag.get_pos()),
lin: i,
});
}
}
}
}