commit method

  1. @override
void commit(
  1. MatrixMap<CellDataType> matrix
)
override

Commit this operation into a cellMatrix

Implementation

@override
void commit(MatrixMap<CellDataType> matrix) {
  // when trying to put an empty cell, free resources instead
  if (cellData.isEmpty) {
    matrix.remove(
      colIndex: cellData.position.dx,
      rowIndex: cellData.position.dy,
    );
    return;
  }

  matrix[cellData.position] = cellData;
}