add search and rescue
This commit is contained in:
27
BGS/LogGenerator/GenericFormat.cs
Normal file
27
BGS/LogGenerator/GenericFormat.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EliteBGS.BGS.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 {
|
||||
public string GenerateLog(Objective objective) {
|
||||
IEnumerable<Type> logs = objective.LogEntries.OfType<Type>();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (logs == null || logs.Count() <= 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
foreach (Type log in logs) {
|
||||
builder.AppendLine(log.ToString());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
4
BGS/LogGenerator/SearchAndRescueFormat.cs
Normal file
4
BGS/LogGenerator/SearchAndRescueFormat.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
public class SearchAndRescueFormat : GenericFormat<SearchAndRescue> {
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
class VistaGenomics : LogFormatter {
|
||||
public string GenerateLog(Objective objective) {
|
||||
IEnumerable<OrganicData> logs = objective.LogEntries.OfType<OrganicData>();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (logs == null || logs.Count() < 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
foreach(OrganicData log in logs) {
|
||||
builder.AppendLine(log.ToString());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
4
BGS/LogGenerator/VistaGenomicsFormat.cs
Normal file
4
BGS/LogGenerator/VistaGenomicsFormat.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
class VistaGenomicsFormat : GenericFormat<VistaGenomicsFormat> {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user