setUnsafe abstract method

void setUnsafe(
  1. Pos pos,
  2. E value
)

Sets the element at a position in the grid.

If the position is not within the bounds of the grid, the behavior is undefined. This method is intended to be used in cases where the position can be trusted, such as an iterator or other trusted synchronous operations.

Example

for (var y = 0; y < grid.height; y++) {
  for (var x = 0; x < grid.width; x++) {
    final pos = Pos(x, y);
    grid.setUnsafe(pos, 1);
  }
}

Implementation

void setUnsafe(Pos pos, E value);