EliteBGS/BGS/LogEntry.cs
Florian Stinglmayr 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

59 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using EDJournal;
namespace EliteBGS.BGS {
public class LogEntry : IComparable<LogEntry> {
private List<Entry> entries = new List<Entry>();
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>
/// Controlling faction of the station this entry was made/turned into.
/// </summary>
public string ControllingFaction { get; set; } = "";
public List<Entry> Entries => entries;
public string Station { get; set; }
public string System { get; set; }
public ulong SystemAddress { get; set; }
public string Faction { get; set; }
/// <summary>
/// Whether this entry was manually added. Manually added entries are not deleted
/// when a new scan is made. Instead they are preserved.
/// </summary>
public bool ManuallyAdded { get; set; }
/// <summary>
/// Whether this entry only benefits the controlling faction or not, default: no
/// </summary>
public virtual bool OnlyControllingFaction {
get { return false; }
}
public virtual int CompareTo(LogEntry other) {
throw new NotImplementedException("not implemented");
}
public string Name => ToString();
}
}