EDBGS/EliteBGS/LogGenerator/GenericFormat.cs
Florian Stinglmayr 5120c7991f implement a summary line
For Pony's bot, implement a summary line that just shows the highlights of the log
2023-02-23 21:44:55 +01:00

33 lines
910 B
C#

using System.Collections.Generic;
using System.Linq;
using System.Text;
using EDPlayerJournal.BGS;
namespace EliteBGS.LogGenerator;
/// <summary>
/// Creates a generic log block, that is simply all LogEntries of type "Type"
/// per line
/// </summary>
/// <typeparam name="Type">LogEntry subtype to work on</typeparam>
public class GenericFormat<Type> : LogFormatter where Type : Transaction {
public string GenerateLog(Objective objective) {
IEnumerable<Type> logs = objective.EnabledOfType<Type>();
StringBuilder builder = new StringBuilder();
if (logs == null || logs.Count() <= 0) {
return "";
}
foreach (Type log in logs) {
builder.AppendLine(log.ToString());
}
return builder.ToString();
}
public string GenerateSummary(Objective objective) {
throw new System.NotImplementedException();
}
}