Compare commits
No commits in common. "c2037f28e2b384db9ce2e93829e463bfc5389ce7" and "3a5d0a90ef87227637cff2e30c007de8725babba" have entirely different histories.
c2037f28e2
...
3a5d0a90ef
@ -1,6 +1,5 @@
|
|||||||
namespace EDPlayerJournal.BGS;
|
namespace EDPlayerJournal.BGS;
|
||||||
|
internal class IncompleteTransaction : Transaction {
|
||||||
public class IncompleteTransaction : Transaction {
|
|
||||||
public Transaction? UnderlyingTransaction { get; set; } = null;
|
public Transaction? UnderlyingTransaction { get; set; } = null;
|
||||||
public string Reason { get; set; } = "";
|
public string Reason { get; set; } = "";
|
||||||
|
|
||||||
|
@ -63,16 +63,10 @@ public partial class MainWindow : Window {
|
|||||||
GenerateLog();
|
GenerateLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleEntries(List<Entry> entries) {
|
private void Loadentries_EntriesLoaded(List<Entry> lines) {
|
||||||
try {
|
try {
|
||||||
TransactionParser parser = new TransactionParser();
|
TransactionParser parser = new TransactionParser();
|
||||||
List<Transaction> transactions = parser.Parse(entries);
|
List<Transaction> transactions = parser.Parse(lines);
|
||||||
|
|
||||||
// Log incomplete and remove them from the results.
|
|
||||||
foreach (var incomplete in transactions.OfType<IncompleteTransaction>()) {
|
|
||||||
Log(incomplete.Reason);
|
|
||||||
transactions.Remove(incomplete);
|
|
||||||
}
|
|
||||||
|
|
||||||
report = new Report(transactions);
|
report = new Report(transactions);
|
||||||
this.entries.ItemsSource = report.Objectives;
|
this.entries.ItemsSource = report.Objectives;
|
||||||
@ -83,10 +77,6 @@ public partial class MainWindow : Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Loadentries_EntriesLoaded(List<Entry> lines) {
|
|
||||||
HandleEntries(lines);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Report_OnLog(string message) {
|
private void Report_OnLog(string message) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
@ -132,7 +122,11 @@ public partial class MainWindow : Window {
|
|||||||
.ToList()
|
.ToList()
|
||||||
;
|
;
|
||||||
|
|
||||||
HandleEntries(entries);
|
List<Transaction> transactions = parser.Parse(entries);
|
||||||
|
report = new Report(transactions);
|
||||||
|
|
||||||
|
this.entries.ItemsSource = report.Objectives;
|
||||||
|
|
||||||
GenerateLog();
|
GenerateLog();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Log("Something went terribly wrong while parsing the E:D player journal.");
|
Log("Something went terribly wrong while parsing the E:D player journal.");
|
||||||
@ -178,7 +172,7 @@ public partial class MainWindow : Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (removed) {
|
if (removed) {
|
||||||
RefreshView();
|
GenerateLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,11 +247,6 @@ public partial class MainWindow : Window {
|
|||||||
};
|
};
|
||||||
|
|
||||||
objective.Transactions.Add(zone);
|
objective.Transactions.Add(zone);
|
||||||
RefreshView();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RefreshView() {
|
|
||||||
entries.Items.Refresh();
|
|
||||||
GenerateLog();
|
GenerateLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +266,7 @@ public partial class MainWindow : Window {
|
|||||||
|
|
||||||
if (int.TryParse(adjust.Profit.Text, out int newprofit)) {
|
if (int.TryParse(adjust.Profit.Text, out int newprofit)) {
|
||||||
sell.Profit = newprofit;
|
sell.Profit = newprofit;
|
||||||
RefreshView();
|
GenerateLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user