2019-11-21 14:25:56 +00:00
|
|
|
|
using System.IO;
|
2019-12-04 01:26:26 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2019-11-11 13:03:48 +00:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Lib.CompilationSteps
|
|
|
|
|
{
|
|
|
|
|
public class IgnoreVortex : ACompilationStep
|
|
|
|
|
{
|
|
|
|
|
private readonly VortexCompiler _vortex;
|
|
|
|
|
|
|
|
|
|
public IgnoreVortex(ACompiler compiler) : base(compiler)
|
|
|
|
|
{
|
2019-11-11 20:03:27 +00:00
|
|
|
|
_vortex = (VortexCompiler) compiler;
|
2019-11-11 13:03:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-04 01:26:26 +00:00
|
|
|
|
public override async ValueTask<Directive> Run(RawSourceFile source)
|
2019-11-11 13:03:48 +00:00
|
|
|
|
{
|
|
|
|
|
if (Path.GetDirectoryName(source.AbsolutePath) != _vortex.DownloadsFolder) return null;
|
|
|
|
|
var result = source.EvolveTo<IgnoredDirectly>();
|
|
|
|
|
result.Reason = "Ignored because it is a Vortex file";
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IState GetState()
|
|
|
|
|
{
|
|
|
|
|
return new State();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonObject("IgnoreVortex")]
|
|
|
|
|
public class State : IState
|
|
|
|
|
{
|
|
|
|
|
public ICompilationStep CreateStep(ACompiler compiler)
|
|
|
|
|
{
|
|
|
|
|
return new IgnoreVortex(compiler);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|