namespace Flyshot.ControllerClientCompat;

/// <summary>
/// 表示飞拍轨迹执行接口的可选参数，字段名对齐旧 `ControllerClient::ExecuteFlyShotTraj`。
/// </summary>
public sealed class FlyshotExecutionOptions
{
    /// <summary>
    /// 初始化飞拍轨迹执行参数。
    /// </summary>
    /// <param name="moveToStart">执行前是否自动移动到轨迹起点。</param>
    /// <param name="method">轨迹生成方法，支持 `icsp`、`doubles` 或 `self-adapt-icsp`。</param>
    /// <param name="saveTrajectory">是否保存轨迹信息。</param>
    /// <param name="useCache">是否优先复用已规划轨迹缓存。</param>
    /// <param name="wait">是否等待机器人执行完整条飞拍轨迹后再返回。</param>
    public FlyshotExecutionOptions(
        bool moveToStart = true,
        string method = "icsp",
        bool saveTrajectory = true,
        bool useCache = true,
        bool wait = true)
    {
        MoveToStart = moveToStart;
        Method = string.IsNullOrWhiteSpace(method) ? "icsp" : method;
        SaveTrajectory = saveTrajectory;
        UseCache = useCache;
        Wait = wait;
    }

    /// <summary>
    /// 获取执行前是否自动移动到轨迹起点。
    /// </summary>
    public bool MoveToStart { get; }

    /// <summary>
    /// 获取轨迹生成方法。
    /// </summary>
    public string Method { get; }

    /// <summary>
    /// 获取是否保存轨迹信息。
    /// </summary>
    public bool SaveTrajectory { get; }

    /// <summary>
    /// 获取是否优先复用已规划轨迹缓存。
    /// </summary>
    public bool UseCache { get; }

    /// <summary>
    /// 获取是否等待机器人执行完整条飞拍轨迹后再返回。
    /// </summary>
    public bool Wait { get; }
}
