Compare commits
No commits in common. "c8e985cb3980806e1d5e54057f92e95b077d2f0a" and "e724955ec86babd702516baf1a454bfd1a4ee6a1" have entirely different histories.
c8e985cb39
...
e724955ec8
@ -11,11 +11,6 @@ namespace NonaBGS.BGS {
|
|||||||
public string Station { get; set; }
|
public string Station { get; set; }
|
||||||
public string System { get; set; }
|
public string System { get; set; }
|
||||||
public string Faction { 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>
|
/// <summary>
|
||||||
/// Whether this entry only benefits the controlling faction or not, default: no
|
/// Whether this entry only benefits the controlling faction or not, default: no
|
||||||
|
@ -16,12 +16,6 @@ namespace NonaBGS.BGS {
|
|||||||
get => entries;
|
get => entries;
|
||||||
set => entries = value;
|
set => entries = value;
|
||||||
}
|
}
|
||||||
public void Clear() {
|
|
||||||
if (entries == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
entries.RemoveAll(x => !x.ManuallyAdded);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Matches(LogEntry e) {
|
public int Matches(LogEntry e) {
|
||||||
int match_count = 0;
|
int match_count = 0;
|
||||||
|
@ -54,7 +54,7 @@ namespace NonaBGS.BGS {
|
|||||||
string current_station = null;
|
string current_station = null;
|
||||||
string controlling_faction = null;
|
string controlling_faction = null;
|
||||||
|
|
||||||
objectives.ForEach(x => x.Clear());
|
this.objectives.ForEach(x => x.LogEntries.Clear());
|
||||||
|
|
||||||
foreach (var e in relevant) {
|
foreach (var e in relevant) {
|
||||||
LogEntry entry = null;
|
LogEntry entry = null;
|
||||||
@ -145,14 +145,12 @@ namespace NonaBGS.BGS {
|
|||||||
|
|
||||||
LogEntry existing = null;
|
LogEntry existing = null;
|
||||||
|
|
||||||
existing = objective.LogEntries.Find(x => {
|
try {
|
||||||
try {
|
existing = objective.LogEntries.Find(x => x.CompareTo(entry) == 0);
|
||||||
return x.CompareTo(entry) == 0;
|
} catch (NotImplementedException) {
|
||||||
} catch (NotImplementedException) {
|
// Equivalent to not having found anything
|
||||||
return false;
|
existing = null;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (collate && existing != null) {
|
if (collate && existing != null) {
|
||||||
existing.Entries.Add(e);
|
existing.Entries.Add(e);
|
||||||
} else if (!collate || existing == null) {
|
} else if (!collate || existing == null) {
|
||||||
|
@ -264,7 +264,6 @@ namespace NonaBGS {
|
|||||||
|
|
||||||
CombatZone zone = new CombatZone();
|
CombatZone zone = new CombatZone();
|
||||||
|
|
||||||
zone.ManuallyAdded = true;
|
|
||||||
zone.Faction = objective.Faction;
|
zone.Faction = objective.Faction;
|
||||||
zone.System = objective.System;
|
zone.System = objective.System;
|
||||||
zone.Station = objective.Station;
|
zone.Station = objective.Station;
|
||||||
|
Reference in New Issue
Block a user