Compare commits

..

No commits in common. "2f4d23d878a2318704df811f4dc310e9cb545253" and "d087c1862acd08fd77afc73b40c3e40242a7f6f6" have entirely different histories.

11 changed files with 10 additions and 55 deletions

View File

@ -11,12 +11,6 @@ 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,23 +9,6 @@ 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,7 +8,6 @@ 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,12 +4,9 @@ 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 var total = objective.LogEntries.OfType<Cartographics>();
.OfType<Cartographics>()
.Where(x => x.IsEnabled)
;
var pages = total.Count(); var pages = total.Count();
long sum = total.Sum(x => x.TotalSum); long sum = total.Sum(x => (x as Cartographics).TotalSum);
if (pages <= 0 || sum <= 0) { if (pages <= 0 || sum <= 0) {
return ""; return "";

View File

@ -5,12 +5,7 @@ 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 MissionFailed[] missions = objective.LogEntries.OfType<MissionFailed>().ToArray();
.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 where Type : LogEntry { public class GenericFormat<Type> : LogFormatter {
public string GenerateLog(Objective objective) { public string GenerateLog(Objective objective) {
IEnumerable<Type> logs = objective.LogEntries.OfType<Type>().Where(x => x.IsEnabled); IEnumerable<Type> logs = objective.LogEntries.OfType<Type>();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (logs == null || logs.Count() <= 0) { if (logs == null || logs.Count() <= 0) {

View File

@ -4,10 +4,7 @@ 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 var total = objective.LogEntries.OfType<SellMicroResources>();
.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,10 +9,7 @@ namespace EliteBGS.BGS.LogGenerator {
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
int total_influence = 0; int total_influence = 0;
var missions = objective.LogEntries var missions = objective.LogEntries.OfType<MissionCompleted>();
.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<OrganicData> { class VistaGenomicsFormat : GenericFormat<VistaGenomicsFormat> {
} }
} }

View File

@ -6,10 +6,7 @@ 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 var missions = objective.LogEntries.OfType<Vouchers>();
.OfType<Vouchers>()
.Where(x => x.IsEnabled)
;
if (missions == null || missions.Count() <= 0) { if (missions == null || missions.Count() <= 0) {
return ""; return "";

View File

@ -61,11 +61,7 @@
</StackPanel> </StackPanel>
<HierarchicalDataTemplate.ItemTemplate> <HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate> <HierarchicalDataTemplate>
<StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Name}"/>
<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>