using System;
using System.Threading;
using System.Threading.Tasks;

namespace StandardScene.Magnetic.Tasking
{
    /// <summary>
    /// FASS 2.0 车型与 LoopMission 衔接接口。
    /// LoopMission 仍通过 <c>goalSite</c> 标签分配目标；车型侧负责一次全程任务执行。
    /// </summary>
    public interface IFass2LoopCar
    {
        bool IsTaskIdle { get; }

        bool HasGoalSite { get; }

        int? GoalSiteId { get; }

        /// <summary>执行 <c>goalSite</c>（或指定目标）对应的全程 FASS 2.0 任务。</summary>
        Task ExecuteGoalTaskAsync(int? goalSiteId = null, double defaultSpeed = -1,
            CancellationToken cancellationToken = default);

        /// <summary>任务到达终点后触发，参数为到达站 ID。</summary>
        event Action<int> TaskCompleted;
    }
}
