// Draw uses a mapping from runes to cells to draw the vault into a grid. It
// returns the grid slice that was drawn.
Draw uses a mapping from runes to cells to draw the vault into a grid. It
returns the grid slice that was drawn.
// Draw uses a mapping from runes to cells to draw the vault into a grid . It // returns the grid slice that was drawn .
func (v *Vault) Draw(gd Grid, fn func(rune) Cell) Grid {
	x, y := 0, 0
	for _, r := range v.content {
		if r == '\n' {
			x = 0
			y++
			continue
		}
		gd.Set(gruid.Point{x, y}, fn(r))
		x++
	}
	return gd.Slice(gruid.NewRange(0, 0, v.size.X, v.size.Y))
}
func ( v * Vault ) Draw ( gd Grid , fn func ( rune ) Cell ) Grid { x , y := 0 , 0 for _ , r := range v . content { if r == '\n' { x = 0 y ++ continue } gd . Set ( gruid . Point { x , y } , fn ( r ) ) x ++ } return gd . Slice ( gruid . NewRange ( 0 , 0 , v . size . X , v . size . Y ) ) }
Draw uses a mapping from runes to cells to draw the vault into a grid.
Draw uses a mapping from runes to cells to draw the vault into a grid .