Compare commits
2 Commits
d087c1862a
...
2f4d23d878
Author | SHA1 | Date | |
---|---|---|---|
2f4d23d878 | |||
773d98a4fb |
@ -11,6 +11,12 @@ namespace EliteBGS.BGS {
|
||||
public string Influence { 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() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
string missionname;
|
||||
|
@ -9,6 +9,23 @@ namespace EliteBGS.BGS {
|
||||
|
||||
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>
|
||||
|
@ -8,6 +8,7 @@ namespace EliteBGS.BGS.LogGenerator {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
SellCargo[] sold = objective.LogEntries
|
||||
.OfType<SellCargo>()
|
||||
.Where(x => x.IsEnabled)
|
||||
.ToArray()
|
||||
;
|
||||
|
||||
|
@ -4,9 +4,12 @@ using EDJournal;
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
public class CartographicsFormat : LogFormatter {
|
||||
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();
|
||||
long sum = total.Sum(x => (x as Cartographics).TotalSum);
|
||||
long sum = total.Sum(x => x.TotalSum);
|
||||
|
||||
if (pages <= 0 || sum <= 0) {
|
||||
return "";
|
||||
|
@ -5,7 +5,12 @@ using EDJournal;
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
public class FailedMissionFormat : LogFormatter {
|
||||
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();
|
||||
|
||||
if (missions.Length <= 0) {
|
||||
|
@ -8,9 +8,9 @@ namespace EliteBGS.BGS.LogGenerator {
|
||||
/// per line
|
||||
/// </summary>
|
||||
/// <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) {
|
||||
IEnumerable<Type> logs = objective.LogEntries.OfType<Type>();
|
||||
IEnumerable<Type> logs = objective.LogEntries.OfType<Type>().Where(x => x.IsEnabled);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (logs == null || logs.Count() <= 0) {
|
||||
|
@ -4,7 +4,10 @@ using EDJournal;
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
public class MicroResourcesFormat : LogFormatter {
|
||||
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);
|
||||
|
||||
if (total == null || total.Count() <= 0 || sum <= 0) {
|
||||
|
@ -9,7 +9,10 @@ namespace EliteBGS.BGS.LogGenerator {
|
||||
StringBuilder output = new StringBuilder();
|
||||
int total_influence = 0;
|
||||
|
||||
var missions = objective.LogEntries.OfType<MissionCompleted>();
|
||||
var missions = objective.LogEntries
|
||||
.OfType<MissionCompleted>()
|
||||
.Where(x => x.IsEnabled)
|
||||
;
|
||||
|
||||
if (missions == null) {
|
||||
return "";
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace EliteBGS.BGS.LogGenerator {
|
||||
class VistaGenomicsFormat : GenericFormat<VistaGenomicsFormat> {
|
||||
class VistaGenomicsFormat : GenericFormat<OrganicData> {
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,10 @@ namespace EliteBGS.BGS.LogGenerator {
|
||||
public class VoucherFormat : LogFormatter {
|
||||
public string GenerateLog(Objective objective) {
|
||||
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) {
|
||||
return "";
|
||||
|
@ -61,7 +61,11 @@
|
||||
</StackPanel>
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<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.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
|
Loading…
Reference in New Issue
Block a user