| | | 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 | | |
| | 25069 | 11 | | public List<Waypoint> Waypoints { get; } |
| | | 12 | | |
| | 50138 | 13 | | public FlightPlan(in Configs.AttackBehaviorConfig.Types.FlightPlan flightPlan) { |
| | 25069 | 14 | | _flightPlan = flightPlan ?? new Configs.AttackBehaviorConfig.Types.FlightPlan(); |
| | | 15 | | // Sort waypoints in descending order based on distance. |
| | 101011 | 16 | | Waypoints = _flightPlan.Waypoints.Select(waypoint => new Waypoint(waypoint)) |
| | 75942 | 17 | | .OrderByDescending(waypoint => waypoint.Distance) |
| | | 18 | | .ToList(); |
| | 25069 | 19 | | } |
| | | 20 | | } |