Make Reports similar to DatFiles with access

This commit is contained in:
Matt Nadareski
2025-02-19 13:24:12 -05:00
parent 7542a79a58
commit 5f76596aa5
7 changed files with 38 additions and 30 deletions

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using SabreTools.DatFiles;
using SabreTools.IO.Logging;
using SabreTools.Reports.Formats;
namespace SabreTools.Reports
{
@@ -30,26 +29,6 @@ namespace SabreTools.Reports
Statistics = statsList;
}
/// <summary>
/// Create a specific type of BaseReport to be used based on a format and user inputs
/// </summary>
/// <param name="statReportFormat">Format of the Statistics Report to be created</param>
/// <param name="statsList">List of statistics objects to set</param>
/// <returns>BaseReport of the specific internal type that corresponds to the inputs</returns>
public static BaseReport? Create(StatReportFormat statReportFormat, List<DatStatistics> statsList)
{
return statReportFormat switch
{
StatReportFormat.None => new ConsoleOutput(statsList),
StatReportFormat.Textfile => new Textfile(statsList),
StatReportFormat.CSV => new CommaSeparatedValue(statsList),
StatReportFormat.HTML => new Html(statsList),
StatReportFormat.SSV => new SemicolonSeparatedValue(statsList),
StatReportFormat.TSV => new TabSeparatedValue(statsList),
_ => null,
};
}
/// <summary>
/// Create and open an output file for writing direct from a set of statistics
/// </summary>