mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move more unnecessary stuff from methods
This commit is contained in:
@@ -701,26 +701,22 @@ namespace SabreTools.Library.DatFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate the user DatData object from the input files
|
/// Populate from multiple paths while returning the invividual headers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputs">Paths to DATs to parse</param>
|
/// <param name="inputs">Paths to DATs to parse</param>
|
||||||
/// <param name="extras">ExtraIni object to apply to the DatFile</param>
|
/// <returns>List of DatHeader objects representing headers</returns>
|
||||||
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
public List<DatHeader> PopulateUserData(List<string> inputs)
|
||||||
/// <returns>List of DatData objects representing headers</returns>
|
|
||||||
public List<DatHeader> PopulateUserData(List<string> inputs, ExtraIni extras, Filter filter)
|
|
||||||
{
|
{
|
||||||
List<ParentablePath> paths = inputs.Select(i => new ParentablePath(i)).ToList();
|
List<ParentablePath> paths = inputs.Select(i => new ParentablePath(i)).ToList();
|
||||||
return PopulateUserData(paths, extras, filter);
|
return PopulateUserData(paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate the user DatData object from the input files
|
/// Populate from multiple paths while returning the invividual headers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputs">Paths to DATs to parse</param>
|
/// <param name="inputs">Paths to DATs to parse</param>
|
||||||
/// <param name="extras">ExtraIni object to apply to the DatFile</param>
|
/// <returns>List of DatHeader objects representing headers</returns>
|
||||||
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
public List<DatHeader> PopulateUserData(List<ParentablePath> inputs)
|
||||||
/// <returns>List of DatData objects representing headers</returns>
|
|
||||||
public List<DatHeader> PopulateUserData(List<ParentablePath> inputs, ExtraIni extras, Filter filter)
|
|
||||||
{
|
{
|
||||||
DatFile[] datFiles = new DatFile[inputs.Count];
|
DatFile[] datFiles = new DatFile[inputs.Count];
|
||||||
InternalStopwatch watch = new InternalStopwatch("Processing individual DATs");
|
InternalStopwatch watch = new InternalStopwatch("Processing individual DATs");
|
||||||
@@ -742,10 +738,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
AddFromExisting(datFiles[i], true);
|
AddFromExisting(datFiles[i], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we have a merged DAT, apply extras and filter it
|
|
||||||
ApplyExtras(extras);
|
|
||||||
ApplyFilter(filter, false /* useTags */);
|
|
||||||
|
|
||||||
watch.Stop();
|
watch.Stop();
|
||||||
|
|
||||||
return datFiles.Select(d => d.Header).ToList();
|
return datFiles.Select(d => d.Header).ToList();
|
||||||
|
|||||||
@@ -195,9 +195,13 @@ namespace SabreTools.Features
|
|||||||
// Populate using the correct set
|
// Populate using the correct set
|
||||||
List<DatHeader> datHeaders;
|
List<DatHeader> datHeaders;
|
||||||
if (updateMode.HasFlag(UpdateMode.DiffAgainst) || updateMode.HasFlag(UpdateMode.BaseReplace))
|
if (updateMode.HasFlag(UpdateMode.DiffAgainst) || updateMode.HasFlag(UpdateMode.BaseReplace))
|
||||||
datHeaders = userInputDat.PopulateUserData(basePaths, Extras, Filter);
|
datHeaders = userInputDat.PopulateUserData(basePaths);
|
||||||
else
|
else
|
||||||
datHeaders = userInputDat.PopulateUserData(inputPaths, Extras, Filter);
|
datHeaders = userInputDat.PopulateUserData(inputPaths);
|
||||||
|
|
||||||
|
// Apply the extras and filter
|
||||||
|
userInputDat.ApplyExtras(Extras);
|
||||||
|
userInputDat.ApplyFilter(Filter, false);
|
||||||
|
|
||||||
// Output only DatItems that are duplicated across inputs
|
// Output only DatItems that are duplicated across inputs
|
||||||
if (updateMode.HasFlag(UpdateMode.DiffDupesOnly))
|
if (updateMode.HasFlag(UpdateMode.DiffDupesOnly))
|
||||||
|
|||||||
Reference in New Issue
Block a user