Files
better-genshin-impact/BetterGenshinImpact/Service/GearTask/Execution/IGearTaskResumable.cs
辉鸭蛋 7f7a34e9ba feat(gear-task): 引入事件驱动的任务执行与历史记录系统
- 新增 IGearTaskEventBus 接口及默认实现,用于解耦执行器与记录器、UI 投影等消费者
- 新增 IGearTaskResumable 接口,支持任务节点内部恢复(如 Pathing 任务可恢复至特定路径点)
- 重构任务执行流程,使用 GearTaskExecutionRunner 替代旧的 GearTaskExecutionManager
- 实现基于磁盘 JSON 的历史记录存储(IGearTaskHistoryStore),支持执行记录的保存、加载与清理
- 为 PathingGearTask 添加恢复能力,通过 PathingGearTaskResumeState 记录断点状态
- 在 PathExecutor 中集成运行时事件通知,支持路径点进入、完成、传送等事件的发布
- 统一执行事件模型(GearTaskExecutionEvent),包含任务定义、节点路径、时间戳等元数据
- 服务注册更新,使用新的执行器、事件总线、历史记录器等组件
2026-05-11 01:57:29 +08:00

14 lines
405 B
C#

using System.Threading;
using System.Threading.Tasks;
namespace BetterGenshinImpact.Service.GearTask.Execution;
/// <summary>
/// 支持节点内部恢复的 GearTask 需要实现的接口。
/// 执行器会在节点执行前注入上次记录下来的恢复令牌。
/// </summary>
public interface IGearTaskResumable
{
Task ApplyResumeTokenAsync(string? resumeTokenJson, CancellationToken ct);
}