| | 1 | | using System.Collections.Generic; |
| | 2 | | using System.Linq; |
| | 3 | |
|
| | 4 | | public class FlightPlan { |
| | 5 | | private Configs.AttackBehaviorConfig.Types.FlightPlan _flightPlan; |
| | 6 | |
|
| | 7 | | public Configs.AttackBehaviorConfig.Types.FlightPlanType Type { |
| 0 | 8 | | get { return _flightPlan.Type; } |
| | 9 | | } |
| | 10 | |
|
| 27465 | 11 | | public List<Waypoint> Waypoints { get; } |
| | 12 | |
|
| 54930 | 13 | | public FlightPlan(in Configs.AttackBehaviorConfig.Types.FlightPlan flightPlan) { |
| 27465 | 14 | | _flightPlan = flightPlan ?? new Configs.AttackBehaviorConfig.Types.FlightPlan(); |
| | 15 | | // Sort waypoints in descending order based on distance. |
| 110595 | 16 | | Waypoints = _flightPlan.Waypoints.Select(waypoint => new Waypoint(waypoint)) |
| 83130 | 17 | | .OrderByDescending(waypoint => waypoint.Distance) |
| | 18 | | .ToList(); |
| 27465 | 19 | | } |
| | 20 | | } |