// Iter iterates a function on all the grid positions and cells.
Iter iterates a function on all the grid positions and cells.
// Iter iterates a function on all the grid positions and cells .
func (gd Grid) Iter(fn func(gruid.Point, Cell)) {
	if gd.Ug == nil {
		return
	}
	w := gd.Ug.Width
	yimax := gd.Rg.Max.Y * w
	cells := gd.Ug.Cells
	for y, yi := 0, gd.Rg.Min.Y*w; yi < yimax; y, yi = y+1, yi+w {
		ximax := yi + gd.Rg.Max.X
		for x, xi := 0, yi+gd.Rg.Min.X; xi < ximax; x, xi = x+1, xi+1 {
			c := cells[xi]
			p := gruid.Point{X: x, Y: y}
			fn(p, c)
		}
	}
}
func ( gd Grid ) Iter ( fn func ( gruid . Point , Cell ) ) { if gd . Ug == nil { return } w := gd . Ug . Width yimax := gd . Rg . Max . Y * w cells := gd . Ug . Cells for y , yi := 0 , gd . Rg . Min . Y * w ; yi < yimax ; y , yi = y + 1 , yi + w { ximax := yi + gd . Rg . Max . X for x , xi := 0 , yi + gd . Rg . Min . X ; xi < ximax ; x , xi = x + 1 , xi + 1 { c := cells [ xi ] p := gruid . Point { X : x , Y : y } fn ( p , c ) } } }
Iter iterates a function on all the grid positions and cells.
Iter iterates a function on all the grid positions and cells .