Files
better-genshin-impact/BetterGenshinImpact/GameTask/Shell/ShellTaskParam.cs
Takaranoao 981068b38c draft:执行shell抽成task,并支持配置 (#1306)
* Shell抽象成为一个Task,并抽出Config

* 代码格式化

* 格式化代码
2025-03-15 20:09:59 +08:00

28 lines
876 B
C#

using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.Model;
namespace BetterGenshinImpact.GameTask.Shell;
public class ShellTaskParam : BaseTaskParam
{
private ShellTaskParam(string command, int configTimeoutSeconds, bool configNoWindow, bool configOutput, bool configDisable)
{
Command = command;
TimeoutSeconds = configTimeoutSeconds;
NoWindow = configNoWindow;
Output = configOutput;
Disable = configDisable;
}
public readonly bool Disable;
public readonly string Command;
public readonly int TimeoutSeconds;
public readonly bool NoWindow;
public readonly bool Output;
public static ShellTaskParam BuildFromConfig(string command, ShellConfig config)
{
return new ShellTaskParam(command, config.Timeout, config.NoWindow, config.Output, config.Disable);
}
}