add vec gloval_it and push in this
This commit is contained in:
1 parent
93b0c65fed
commit
60bd764bcf
2 files changed
+15
-2
No files matched your search
@@ -4,8 +4,8 @@
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum Intention {
|
||||
MoveTo,
|
||||
StakedOut,
|
||||
MoveTo((i32, i32)),
|
||||
StakedOut((i32, i32)),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user