add number of passengers
This commit is contained in:
parent
6f9d3a64ff
commit
ea07c4dbcb
@ -7,7 +7,8 @@ namespace EliteBGS.LogGenerator;
|
|||||||
|
|
||||||
public class MissionFormat : LogFormatter {
|
public class MissionFormat : LogFormatter {
|
||||||
public string GenerateLog(Objective objective) {
|
public string GenerateLog(Objective objective) {
|
||||||
Dictionary<string, Dictionary<string, int>> collated = new Dictionary<string, Dictionary<string, int>>();
|
Dictionary<string, Dictionary<string, int>> collated = new();
|
||||||
|
Dictionary<string, ulong> passengers = new();
|
||||||
StringBuilder output = new StringBuilder();
|
StringBuilder output = new StringBuilder();
|
||||||
int total_influence = 0;
|
int total_influence = 0;
|
||||||
|
|
||||||
@ -28,6 +29,15 @@ public class MissionFormat : LogFormatter {
|
|||||||
++collated[m.MissionName][m.Influence];
|
++collated[m.MissionName][m.Influence];
|
||||||
|
|
||||||
total_influence += m.Influence.Length;
|
total_influence += m.Influence.Length;
|
||||||
|
|
||||||
|
if (m.AcceptedEntry != null &&
|
||||||
|
m.AcceptedEntry.Mission != null &&
|
||||||
|
m.AcceptedEntry.Mission.IsPassengerMission) {
|
||||||
|
if (!passengers.ContainsKey(m.MissionName)) {
|
||||||
|
passengers[m.MissionName] = 0;
|
||||||
|
}
|
||||||
|
passengers[m.MissionName] += (m.AcceptedEntry.Mission.PassengerCount ?? 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var mission in collated) {
|
foreach (var mission in collated) {
|
||||||
@ -37,9 +47,15 @@ public class MissionFormat : LogFormatter {
|
|||||||
output.AppendFormat("Inf{0} x{1}, ", influence.Key, influence.Value);
|
output.AppendFormat("Inf{0} x{1}, ", influence.Key, influence.Value);
|
||||||
}
|
}
|
||||||
output.Remove(output.Length - 2, 2); // remove last ", "
|
output.Remove(output.Length - 2, 2); // remove last ", "
|
||||||
output.Append(")\n\n");
|
output.Append(")");
|
||||||
|
|
||||||
|
if (passengers.ContainsKey(mission.Key)) {
|
||||||
|
output.AppendFormat(" ({0} Passengers)", passengers[mission.Key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output.Append("\n\n");
|
||||||
|
|
||||||
var support = objective.EnabledOfType<InfluenceSupport>();
|
var support = objective.EnabledOfType<InfluenceSupport>();
|
||||||
foreach (InfluenceSupport inf in support) {
|
foreach (InfluenceSupport inf in support) {
|
||||||
output.Append(inf.ToString());
|
output.Append(inf.ToString());
|
||||||
|
Loading…
Reference in New Issue
Block a user