mirrorCells method

void mirrorCells(
  1. List<String> cells,
  2. String direction
)

It takes a list of cells and a direction, and then it moves to each cell and calls the appropriate mirror function

Args: cells (List): A list of cells to mirror. direction (String): The direction to mirror the cells in.

Implementation

void mirrorCells(List<String> cells, String direction) {
  switch (direction) {
    case "horizontal":
      {
        for (final String s in cells) {
          _commandCaller
            ..move(
              "toPosition",
              <int>[_rows[s[0]]!, _columns[s[1]]!],
            )
            ..color("mirrorCellHorizontal", <dynamic>[]);
        }
      }
      break;
    case "vertical":
      {
        for (final String s in cells) {
          _commandCaller
            ..move(
              "toPosition",
              <int>[_rows[s[0]]!, _columns[s[1]]!],
            )
            ..color("mirrorCellVertical", <dynamic>[]);
        }
      }
      break;
    default:
      {
        _error = CatError.commandNotImplemented;
      }
      break;
  }
}