operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Overriding the == operator.

Implementation

@override
bool operator ==(Object other) {
  if (other is! BasicShape) {
    return false;
  }
  for (int i = 0; i < grid.length; i++) {
    for (int j = 0; j < grid[i].length; j++) {
      if (validatePosition(i, j)) {
        if (other.grid[i][j] != grid[i][j]) {
          return false;
        }
      }
    }
  }

  return true;
}