static IEnumerable<DronePosition> VariateByZones(DronePosition pos, Point[] zones) { for(var i = 0; i < zones.Length; ++i) { var zone = zones[i]; if (Dist(pos.Point, zone) <= pos.Radius + 100) yield return new DronePosition(zone, 100, zone: i); } yield return new DronePosition(pos.Point, pos.Radius, -1); }
static IEnumerable <DronePosition> VariateByZones(DronePosition pos, Point[] zones) { for (var i = 0; i < zones.Length; ++i) { var zone = zones[i]; if (Dist(pos.Point, zone) <= pos.Radius + 100) { yield return(new DronePosition(zone, 100, zone: i)); } } yield return(new DronePosition(pos.Point, pos.Radius, -1)); }
static DronePosition Move(DronePosition pos, int turns = 1) { return(new DronePosition(pos.Point, pos.Radius + turns * 100, zone: null)); }
static DronePosition Move(DronePosition pos, int turns = 1) { return new DronePosition(pos.Point, pos.Radius + turns * 100, zone:null); }