neighbours property

List<Zone>? neighbours

Implementation

List<Zone>? get neighbours {
  if (_neighbours == null) {
    final x = this.x.toDouble();
    final y = this.y.toDouble();
    _neighbours = [
      Zone.byXY(x + 1, y, level),
      Zone.byXY(x, y + 1, level),
      Zone.byXY(x + 1, y + 1, level),
      Zone.byXY(x - 1, y, level),
      Zone.byXY(x, y - 1, level),
      Zone.byXY(x - 1, y - 1, level),
    ];
  }
  return _neighbours;
}