contains method

bool contains(
  1. TileIdentity other
)

Implementation

bool contains(TileIdentity other) {
  final zoomDifference = other.z - z;
  if (zoomDifference == 0) {
    return this == other;
  } else if (zoomDifference < 0) {
    return false;
  }
  final divisor = pow(2, zoomDifference).toInt();
  final translatedX = other.x ~/ divisor;
  final translatedY = other.y ~/ divisor;
  return translatedX == x && translatedY == y;
}