diff --git a/src/fot/entitylist.rs b/src/fot/entitylist.rs index ac8f185..a5bfbaf 100644 --- a/src/fot/entitylist.rs +++ b/src/fot/entitylist.rs @@ -159,3 +159,12 @@ impl DecoderCtx for EntityList { self.enc_size } } + +impl<'a> IntoIterator for &'a EntityList { + type Item = &'a Entity; + type IntoIter = std::slice::Iter<'a, Entity>; + + fn into_iter(self) -> Self::IntoIter { + self.ents.iter() + } +} \ No newline at end of file diff --git a/src/fot/world.rs b/src/fot/world.rs index 8b7f011..98aa7d0 100644 --- a/src/fot/world.rs +++ b/src/fot/world.rs @@ -37,6 +37,9 @@ impl World { self.entlist .encode(EntityEncoding::File)? .dump(Path::new("D:\\entlist.ent"))?;*/ + for ent in &self.entlist { + println!("{}", ent.type_idx); + } Ok(()) }