wabbajack/Wabbajack.Lib/CompilationSteps/IgnoreGameFiles.cs
2019-10-30 20:24:42 -06:00

37 lines
956 B
C#

using Newtonsoft.Json;
using Wabbajack.Common;
namespace Wabbajack.Lib.CompilationSteps
{
public class IgnoreGameFiles : ACompilationStep
{
private readonly string _startDir;
public IgnoreGameFiles(Compiler compiler) : base(compiler)
{
_startDir = Consts.GameFolderFilesDir + "\\";
}
public override Directive Run(RawSourceFile source)
{
if (!source.Path.StartsWith(_startDir)) return null;
var i = source.EvolveTo<IgnoredDirectly>();
i.Reason = "Default game file";
return i;
}
public override IState GetState()
{
return new State();
}
[JsonObject("IgnoreGameFiles")]
public class State : IState
{
public ICompilationStep CreateStep(Compiler compiler)
{
return new IgnoreGameFiles(compiler);
}
}
}
}