[DatFile, Utilities] Some organization to factories

This commit is contained in:
Matt Nadareski
2017-11-17 15:54:29 -08:00
parent 68e30cd7d8
commit d0af319830
2 changed files with 13 additions and 2 deletions

View File

@@ -3056,7 +3056,7 @@ namespace SabreTools.Library.DatFiles
// Now parse the correct type of DAT // Now parse the correct type of DAT
try try
{ {
Utilities.GetDatFile(Utilities.GetDatFormat(filename), this)?.ParseFile(filename, sysid, srcid, keep, clean, remUnicode); Utilities.GetDatFile(filename, this)?.ParseFile(filename, sysid, srcid, keep, clean, remUnicode);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -538,7 +538,6 @@ namespace SabreTools.Library.Tools
} }
} }
/// <summary> /// <summary>
/// Create a specific type of BaseReport to be used based on a format and user inputs /// Create a specific type of BaseReport to be used based on a format and user inputs
/// </summary> /// </summary>
@@ -564,6 +563,18 @@ namespace SabreTools.Library.Tools
return null; return null;
} }
/// <summary>
/// Create a specific type of DatFile to be used based on an input file and a base DAT
/// </summary>
/// <param name="input">Name of the file to determine the DAT format from</param>
/// <param name="baseDat">DatFile containing the information to use in specific operations</param>
/// <returns>DatFile of the specific internal type that corresponds to the inputs</returns>
public static DatFile GetDatFile(string input, DatFile baseDat)
{
DatFormat datFormat = GetDatFormat(input);
return GetDatFile(datFormat, baseDat);
}
/// <summary> /// <summary>
/// Create a specific type of DatFile to be used based on a format and a base DAT /// Create a specific type of DatFile to be used based on a format and a base DAT
/// </summary> /// </summary>