mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-03 11:05:16 +08:00
26 lines
678 B
C#
26 lines
678 B
C#
using System.Threading.Tasks;
|
|
using System.Text.Json;
|
|
using BetterGenshinImpact.GameTask.AutoPathing;
|
|
using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
|
|
|
namespace BetterGenshinImpact.Core.Script.Dependence;
|
|
|
|
public class AutoPathingScript(string rootPath)
|
|
{
|
|
public async Task Run(string json)
|
|
{
|
|
var task = JsonSerializer.Deserialize<PathingTask>(json);
|
|
if (task == null)
|
|
{
|
|
return;
|
|
}
|
|
await new PathExecutor(CancellationContext.Instance.Cts).Pathing(task);
|
|
}
|
|
|
|
public async Task RunFile(string path)
|
|
{
|
|
var json = await new LimitedFile(rootPath).ReadText(path);
|
|
await Run(json);
|
|
}
|
|
}
|