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)]
|
#[derive(Clone)]
|
||||||
pub enum Intention {
|
pub enum Intention {
|
||||||
MoveTo,
|
MoveTo((i32, i32)),
|
||||||
StakedOut,
|
StakedOut((i32, i32)),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[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