diff --git a/src/activities/overworld/worldgen.rs b/src/activities/overworld/worldgen.rs index bf75f9a..3cfe2aa 100644 --- a/src/activities/overworld/worldgen.rs +++ b/src/activities/overworld/worldgen.rs @@ -430,21 +430,21 @@ impl Overworld { chunk.get_tile(local_chunk_coords).unwrap() } - /// Iterate over all generated tiles and its engine/world cordinates. using a [`Tile`] at the given world coordinates, or `None` if that tile has not - /// been generated yet. + /// Iterate over all generated tiles in all generated chunks and their engine/world + /// cordinates. pub fn iter_tiles(&self) -> impl Iterator { - self.iter_tilese_private().map(|(coords, tile)| { + self.iter_tiles_private().map(|(coords, tile)| { let mut w_coords = coords; w_coords.y *= -1; (w_coords, tile) }) } - /// iterate over all tiles and its global coords - fn iter_tilese_private(&self) -> impl Iterator { + /// Iterate over all generated tiles in all generated chunks. + fn iter_tiles_private(&self) -> impl Iterator { self.chunks.iter().flat_map(|(chunk_coords, chunk)| { chunk.iter_tiles().map(|(local_coords, tile)| { - // never fail because chunksize fits alswas into i32 + // never fail because chunksize fits always into i32 let local_coords: IVec2 = local_coords.try_into().unwrap(); (local_coords + (*chunk_coords * CHUNK_SIZE as i32), tile) })