naming
Signed-off-by: Fabrizio Iannetti <fabrizio.iannetti@gmail.com>
This commit is contained in:
parent
4d81501fa6
commit
9ce23811d5
|
@ -26,7 +26,7 @@ pub struct CellGrid {
|
||||||
num_y: u32,
|
num_y: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CellGridCells<'a> {
|
pub struct CellGridIterator<'a> {
|
||||||
grid: &'a CellGrid,
|
grid: &'a CellGrid,
|
||||||
|
|
||||||
// current position when iterating
|
// current position when iterating
|
||||||
|
@ -49,8 +49,8 @@ impl CellGrid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn iter(&self) -> CellGridCells {
|
pub fn iter(&self) -> CellGridIterator {
|
||||||
CellGridCells {
|
CellGridIterator {
|
||||||
grid: self,
|
grid: self,
|
||||||
pos_x: 0,
|
pos_x: 0,
|
||||||
pos_y: 0,
|
pos_y: 0,
|
||||||
|
@ -78,7 +78,7 @@ impl CellGrid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> CellGridCells<'a> {
|
impl<'a> CellGridIterator<'a> {
|
||||||
fn compute_cell(&mut self) -> () {
|
fn compute_cell(&mut self) -> () {
|
||||||
let grid: &'a CellGrid = self.grid;
|
let grid: &'a CellGrid = self.grid;
|
||||||
self.curr.pos_x = self.pos_x;
|
self.curr.pos_x = self.pos_x;
|
||||||
|
@ -96,7 +96,7 @@ impl<'a> CellGridCells<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for CellGridCells<'a> {
|
impl<'a> Iterator for CellGridIterator<'a> {
|
||||||
type Item = Cell;
|
type Item = Cell;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
|
Loading…
Reference in New Issue