2022-02-09 09:44:25 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using EDJournal;
|
|
|
|
|
|
|
|
|
|
namespace EliteBGS.BGS {
|
|
|
|
|
public class SearchAndRescue : LogEntry {
|
|
|
|
|
public SearchAndRescue (SearchAndRescueEntry e) {
|
|
|
|
|
Entries.Add(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public long Count {
|
|
|
|
|
get {
|
|
|
|
|
return Entries.OfType<SearchAndRescueEntry>().Sum(x => x.Count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-09 09:49:56 +01:00
|
|
|
|
public long Reward {
|
|
|
|
|
get {
|
|
|
|
|
return Entries.OfType<SearchAndRescueEntry>().Sum(x => x.Reward);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-09 09:44:25 +01:00
|
|
|
|
public string NameLocalised {
|
|
|
|
|
get {
|
|
|
|
|
return Entries.OfType<SearchAndRescueEntry>().First().NameLocalised;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int CompareTo(LogEntry o) {
|
|
|
|
|
if (o == null || o.GetType() != typeof(SearchAndRescue)) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SearchAndRescue other = o as SearchAndRescue;
|
|
|
|
|
|
|
|
|
|
if (other.System == System &&
|
|
|
|
|
other.Station == Station &&
|
|
|
|
|
other.Faction == Faction &&
|
|
|
|
|
other.NameLocalised == NameLocalised) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
2022-02-09 09:49:56 +01:00
|
|
|
|
return string.Format("Contributed {0} {1} to Search and Rescue ({2})",
|
|
|
|
|
Count,
|
|
|
|
|
NameLocalised,
|
|
|
|
|
Credits.FormatCredits(Reward)
|
|
|
|
|
);
|
2022-02-09 09:44:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool OnlyControllingFaction => true;
|
|
|
|
|
}
|
|
|
|
|
}
|