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 // Create the sorting object to use and rebuild the needed files
DatTool.RebuildGeneric( Rebuilder.RebuildGeneric(
need, need,
onlyDirs, onlyDirs,
outDir: _depots.Keys.ToList()[0], 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(); List<string> onlineDepots = _depots.Where(d => d.Value.Item2).Select(d => d.Key).ToList();
// Now scan all of those depots and rebuild // Now scan all of those depots and rebuild
DatTool.RebuildDepot( Rebuilder.RebuildDepot(
datFile, datFile,
onlineDepots, onlineDepots,
outDir: outputFolder, outDir: outputFolder,

View File

@@ -13,8 +13,17 @@ using SabreTools.Skippers;
// This file represents all methods related to rebuilding from a DatFile // This file represents all methods related to rebuilding from a DatFile
namespace SabreTools.DatFiles 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> /// <summary>
/// Process the DAT and find all matches in input files and folders assuming they're a depot /// Process the DAT and find all matches in input files and folders assuming they're a depot
/// </summary> /// </summary>

View File

@@ -103,9 +103,9 @@ namespace SabreTools.Features
// If we have the depot flag, respect it // If we have the depot flag, respect it
bool success; bool success;
if (Header.InputDepot?.IsActive ?? false) 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 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 we have a success and we're updating the DAT, write it out
if (success && updateDat) if (success && updateDat)
@@ -144,9 +144,9 @@ namespace SabreTools.Features
// If we have the depot flag, respect it // If we have the depot flag, respect it
bool success; bool success;
if (Header.InputDepot?.IsActive ?? false) 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 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 we have a success and we're updating the DAT, write it out
if (success && updateDat) if (success && updateDat)