getNearbyHazards method

List<Hazard> getNearbyHazards(
  1. RaliPosition point,
  2. double radiusMeters
)

Gets nearby hazards within radius

Implementation

List<Hazard> getNearbyHazards(RaliPosition point, double radiusMeters) {
  if (hazards == null) return [];

  return hazards!.where((hazard) {
    final distance = hazard.location.distanceTo(point);
    return distance <= radiusMeters;
  }).toList();
}