setCell method

void setCell(
  1. int x,
  2. int y,
  3. Cell cell
)

Sets the cell at (x, y) to cell. Does nothing if coordinates are out of bounds.

Implementation

void setCell(int x, int y, Cell cell) {
  if (x < 0 || x >= width || y < 0 || y >= height) return;
  cells[_index(x, y)] = cell;
}