impl mutable IntoIter for EntityList
This commit is contained in:
parent
5709e81df0
commit
b8d48483f1
2 changed files with 13 additions and 0 deletions
|
|
@ -178,3 +178,12 @@ impl<'a> IntoIterator for &'a EntityList {
|
||||||
(1..).zip(&self.ents)
|
(1..).zip(&self.ents)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoIterator for &'a mut EntityList {
|
||||||
|
type Item = (usize, &'a mut Entity);
|
||||||
|
type IntoIter = std::iter::Zip<std::ops::RangeFrom<usize>, std::slice::IterMut<'a, Entity>>;
|
||||||
|
|
||||||
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
|
(1..).zip(&mut self.ents)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ impl World {
|
||||||
pub fn test(&mut self) -> Result<(), FE> {
|
pub fn test(&mut self) -> Result<(), FE> {
|
||||||
//let actor_type = self.entlist.get_type_idx("Actor").unwrap();
|
//let actor_type = self.entlist.get_type_idx("Actor").unwrap();
|
||||||
//let ent = self.entlist.get_entity_mut(2122);
|
//let ent = self.entlist.get_entity_mut(2122);
|
||||||
|
for (id, ent) in &mut self.entlist {
|
||||||
|
ent.flags = 1;
|
||||||
|
}
|
||||||
|
|
||||||
let ent = self.entlist.get_entity_mut(2158);
|
let ent = self.entlist.get_entity_mut(2158);
|
||||||
let esh = ent.get_esh()?;
|
let esh = ent.get_esh()?;
|
||||||
for (name, value) in &esh.props {
|
for (name, value) in &esh.props {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue