using CounterDrone.Core.Models;
using SQLite;

namespace CounterDrone.Core.Models
{
    /// <summary>编队模板</summary>
    [Table("FormationTemplate")]
    public class FormationTemplate
    {
        [PrimaryKey]
        public string Id { get; set; } = "";
        public string Name { get; set; } = "";
        public int FormationMode { get; set; }
        public int LateralCount { get; set; } = 1;
        public int LongitudinalCount { get; set; } = 1;
        public double LateralSpacing { get; set; }
        public double LongitudinalSpacing { get; set; }
        public int LateralAxis { get; set; } = 2;
        public int LongitudinalAxis { get; set; } = 0;

        public RoutePlan ToRoutePlan()
        {
            return new RoutePlan
            {
                FormationMode = FormationMode,
                LateralCount = LateralCount,
                LongitudinalCount = LongitudinalCount,
                LateralSpacing = LateralSpacing,
                LongitudinalSpacing = LongitudinalSpacing,
                LateralAxis = LateralAxis,
                LongitudinalAxis = LongitudinalAxis,
            };
        }
    }
}
