void Update(CellUpdator updator, bool createBuffer) { Cell[,] target; if (createBuffer) { target = NewBoard(); } else { target = cells; } for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { target[x, y].Value = updator(cells[x, y]); } } cells = target; }
public void UpdateInPlace(CellUpdator updator) { Update(updator, false); }
public void Update(CellUpdator updator) { Update(updator, true); }