find method

ChessPos? find(
  1. String matchCode
)

Find a chess by a type code

Implementation

ChessPos? find(String matchCode) {
  ChessPos? pos;
  int rowNumber = 0;
  _rows.any((row) {
    int start = row.indexOf(matchCode);
    if (start > -1) {
      pos = ChessPos(start, rowNumber);
      return true;
    }
    rowNumber++;
    return false;
  });
  return pos;
}