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 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;

View File

@ -9,23 +9,6 @@ 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>

View File

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

View File

@ -4,12 +4,9 @@ using EDJournal;
namespace EliteBGS.BGS.LogGenerator {
public class CartographicsFormat : LogFormatter {
public string GenerateLog(Objective objective) {
var total = objective.LogEntries
.OfType<Cartographics>()
.Where(x => x.IsEnabled)
;
var total = objective.LogEntries.OfType<Cartographics>();
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) {
return "";

View File

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

View File

@ -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 where Type : LogEntry {
public class GenericFormat<Type> : LogFormatter {
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();
if (logs == null || logs.Count() <= 0) {

View File

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

View File

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

View File

@ -1,4 +1,4 @@
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 string GenerateLog(Objective objective) {
StringBuilder builder = new StringBuilder();
var missions = objective.LogEntries
.OfType<Vouchers>()
.Where(x => x.IsEnabled)
;
var missions = objective.LogEntries.OfType<Vouchers>();
if (missions == null || missions.Count() <= 0) {
return "";

View File

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