using System;
using SQLite;
using CounterDrone.Core.Models;

namespace CounterDrone.Core.Models
{
    /// <summary>想定数据：装备部署</summary>
    [Table("ScenarioUnit")]
    public class ScenarioUnit
    {
        [PrimaryKey]
        public string Id { get; set; } = Guid.NewGuid().ToString();

        [Indexed]
        public string ScenarioId { get; set; } = string.Empty;

        /// <summary>外键 → LaunchPlatformSpec（发射平台）</summary>
        public string LaunchPlatformSpecId { get; set; } = string.Empty;

        /// <summary>外键 → SensorSpec（探测设备）</summary>
        public string SensorSpecId { get; set; } = string.Empty;

        public string Description { get; set; } = string.Empty;

        public int EquipmentRole { get; set; } = (int)Models.EquipmentRole.LaunchPlatform;

        public int Quantity { get; set; } = 1;

        public string WaveId { get; set; } = string.Empty;

        public double PositionX { get; set; }
        public double PositionY { get; set; }
        public double PositionZ { get; set; }

        public int? AerosolType { get; set; }

        /// <summary>外键 → AmmunitionSpec（挂载的弹药规格，前端配置用）</summary>
        public string AmmunitionSpecId { get; set; } = string.Empty;

        public int? MunitionCount { get; set; }

        public int Source { get; set; } = (int)ConfigSource.Manual;
    }
}
