Compare commits

...

2 Commits

Author SHA1 Message Date
2f4d23d878 add date time of the mission to the overview
This helps with pre- and post-tick evaluations.
2022-04-06 16:59:11 +02:00
773d98a4fb allow exclusion of specific log entries from discord log 2022-04-06 16:33:04 +02:00
11 changed files with 55 additions and 10 deletions

View File

@ -11,6 +11,12 @@ namespace EliteBGS.BGS {
public string Influence { get; set; } public string Influence { get; set; }
public MissionCompletedEntry RelevantMission { get; set; } public MissionCompletedEntry RelevantMission { get; set; }
public override string CompletedAt {
get {
return RelevantMission.Timestamp.ToString("dd.MM.yyyy hh:mm UTC");
}
}
public override string ToString() { public override string ToString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
string missionname; string missionname;

View File

@ -9,6 +9,23 @@ namespace EliteBGS.BGS {
public bool IsExpanded { get; set; } public bool IsExpanded { get; set; }
public bool IsEnabled { get; set; } = true;
public virtual string CompletedAt {
get {
var items = Entries
.OrderBy(x => x.Timestamp)
.ToArray()
;
if (items == null || items.Length == 0) {
return "Unknown";
}
Entry last = items.Last();
return last.Timestamp.ToString("dd.MM.yyyy hh:mm UTC");
}
}
/// <summary> /// <summary>
/// Controlling faction of the station this entry was made/turned into. /// Controlling faction of the station this entry was made/turned into.
/// </summary> /// </summary>

View File

@ -8,6 +8,7 @@ namespace EliteBGS.BGS.LogGenerator {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
SellCargo[] sold = objective.LogEntries SellCargo[] sold = objective.LogEntries
.OfType<SellCargo>() .OfType<SellCargo>()
.Where(x => x.IsEnabled)
.ToArray() .ToArray()
; ;

View File

@ -4,9 +4,12 @@ using EDJournal;
namespace EliteBGS.BGS.LogGenerator { namespace EliteBGS.BGS.LogGenerator {
public class CartographicsFormat : LogFormatter { public class CartographicsFormat : LogFormatter {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
var total = objective.LogEntries.OfType<Cartographics>(); var total = objective.LogEntries
.OfType<Cartographics>()
.Where(x => x.IsEnabled)
;
var pages = total.Count(); var pages = total.Count();
long sum = total.Sum(x => (x as Cartographics).TotalSum); long sum = total.Sum(x => x.TotalSum);
if (pages <= 0 || sum <= 0) { if (pages <= 0 || sum <= 0) {
return ""; return "";

View File

@ -5,7 +5,12 @@ using EDJournal;
namespace EliteBGS.BGS.LogGenerator { namespace EliteBGS.BGS.LogGenerator {
public class FailedMissionFormat : LogFormatter { public class FailedMissionFormat : LogFormatter {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
MissionFailed[] missions = objective.LogEntries.OfType<MissionFailed>().ToArray(); MissionFailed[] missions = objective
.LogEntries
.OfType<MissionFailed>()
.Where(x => x.IsEnabled)
.ToArray()
;
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (missions.Length <= 0) { if (missions.Length <= 0) {

View File

@ -8,9 +8,9 @@ namespace EliteBGS.BGS.LogGenerator {
/// per line /// per line
/// </summary> /// </summary>
/// <typeparam name="Type">LogEntry subtype to work on</typeparam> /// <typeparam name="Type">LogEntry subtype to work on</typeparam>
public class GenericFormat<Type> : LogFormatter { public class GenericFormat<Type> : LogFormatter where Type : LogEntry {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
IEnumerable<Type> logs = objective.LogEntries.OfType<Type>(); IEnumerable<Type> logs = objective.LogEntries.OfType<Type>().Where(x => x.IsEnabled);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (logs == null || logs.Count() <= 0) { if (logs == null || logs.Count() <= 0) {

View File

@ -4,7 +4,10 @@ using EDJournal;
namespace EliteBGS.BGS.LogGenerator { namespace EliteBGS.BGS.LogGenerator {
public class MicroResourcesFormat : LogFormatter { public class MicroResourcesFormat : LogFormatter {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
var total = objective.LogEntries.OfType<SellMicroResources>(); var total = objective.LogEntries
.OfType<SellMicroResources>()
.Where(x => x.IsEnabled)
;
long sum = total.Sum(x => x.TotalSum); long sum = total.Sum(x => x.TotalSum);
if (total == null || total.Count() <= 0 || sum <= 0) { if (total == null || total.Count() <= 0 || sum <= 0) {

View File

@ -9,7 +9,10 @@ namespace EliteBGS.BGS.LogGenerator {
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
int total_influence = 0; int total_influence = 0;
var missions = objective.LogEntries.OfType<MissionCompleted>(); var missions = objective.LogEntries
.OfType<MissionCompleted>()
.Where(x => x.IsEnabled)
;
if (missions == null) { if (missions == null) {
return ""; return "";

View File

@ -1,4 +1,4 @@
namespace EliteBGS.BGS.LogGenerator { namespace EliteBGS.BGS.LogGenerator {
class VistaGenomicsFormat : GenericFormat<VistaGenomicsFormat> { class VistaGenomicsFormat : GenericFormat<OrganicData> {
} }
} }

View File

@ -6,7 +6,10 @@ namespace EliteBGS.BGS.LogGenerator {
public class VoucherFormat : LogFormatter { public class VoucherFormat : LogFormatter {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
var missions = objective.LogEntries.OfType<Vouchers>(); var missions = objective.LogEntries
.OfType<Vouchers>()
.Where(x => x.IsEnabled)
;
if (missions == null || missions.Count() <= 0) { if (missions == null || missions.Count() <= 0) {
return ""; return "";

View File

@ -61,7 +61,11 @@
</StackPanel> </StackPanel>
<HierarchicalDataTemplate.ItemTemplate> <HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate> <HierarchicalDataTemplate>
<TextBlock Text="{Binding Name}"/> <StackPanel Orientation="Horizontal">
<CheckBox Focusable="False" IsChecked="{Binding IsEnabled}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding CompletedAt}" Margin="5,0,5,0" HorizontalAlignment="Right"/>
<TextBlock Text="{Binding Name}" FontWeight="DemiBold"/>
</StackPanel>
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate> </HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate> </HierarchicalDataTemplate>