Rebuilding to own class

This commit is contained in:
Matt Nadareski
2020-12-10 14:31:00 -08:00
parent dab6aaddf1
commit 0af9869978
4 changed files with 16 additions and 7 deletions

View File

@@ -189,7 +189,7 @@ have a current entry in the DAT index.";
}
// Create the sorting object to use and rebuild the needed files
DatTool.RebuildGeneric(
Rebuilder.RebuildGeneric(
need,
onlyDirs,
outDir: _depots.Keys.ToList()[0],

View File

@@ -64,7 +64,7 @@ structure according to the original DAT master directory tree structure.";
List<string> onlineDepots = _depots.Where(d => d.Value.Item2).Select(d => d.Key).ToList();
// Now scan all of those depots and rebuild
DatTool.RebuildDepot(
Rebuilder.RebuildDepot(
datFile,
onlineDepots,
outDir: outputFolder,

View File

@@ -13,8 +13,17 @@ using SabreTools.Skippers;
// This file represents all methods related to rebuilding from a DatFile
namespace SabreTools.DatFiles
{
public partial class DatTool
public class Rebuilder
{
#region Logging
/// <summary>
/// Logging object
/// </summary>
private static readonly Logger logger = new Logger();
#endregion
/// <summary>
/// Process the DAT and find all matches in input files and folders assuming they're a depot
/// </summary>

View File

@@ -103,9 +103,9 @@ namespace SabreTools.Features
// If we have the depot flag, respect it
bool success;
if (Header.InputDepot?.IsActive ?? false)
success = DatTool.RebuildDepot(datdata, Inputs, Path.Combine(OutputDir, datdata.Header.FileName), date, delete, inverse, outputFormat);
success = Rebuilder.RebuildDepot(datdata, Inputs, Path.Combine(OutputDir, datdata.Header.FileName), date, delete, inverse, outputFormat);
else
success = DatTool.RebuildGeneric(datdata, Inputs, Path.Combine(OutputDir, datdata.Header.FileName), quickScan, date, delete, inverse, outputFormat, asFiles);
success = Rebuilder.RebuildGeneric(datdata, Inputs, Path.Combine(OutputDir, datdata.Header.FileName), quickScan, date, delete, inverse, outputFormat, asFiles);
// If we have a success and we're updating the DAT, write it out
if (success && updateDat)
@@ -144,9 +144,9 @@ namespace SabreTools.Features
// If we have the depot flag, respect it
bool success;
if (Header.InputDepot?.IsActive ?? false)
success = DatTool.RebuildDepot(datdata, Inputs, OutputDir, date, delete, inverse, outputFormat);
success = Rebuilder.RebuildDepot(datdata, Inputs, OutputDir, date, delete, inverse, outputFormat);
else
success = DatTool.RebuildGeneric(datdata, Inputs, OutputDir, quickScan, date, delete, inverse, outputFormat, asFiles);
success = Rebuilder.RebuildGeneric(datdata, Inputs, OutputDir, quickScan, date, delete, inverse, outputFormat, asFiles);
// If we have a success and we're updating the DAT, write it out
if (success && updateDat)