Compare commits
No commits in common. "47d3fd778eafba5574b92c664e18826ff89f2791" and "0e691b2116eef14f2889a69719fa258129e5209d" have entirely different histories.
47d3fd778e
...
0e691b2116
@ -12,15 +12,10 @@ namespace EDJournal {
|
|||||||
if (factions != null) {
|
if (factions != null) {
|
||||||
foreach (JObject faction in factions.Children<JObject>()) {
|
foreach (JObject faction in factions.Children<JObject>()) {
|
||||||
string faction_name = faction.Value<string>("Faction");
|
string faction_name = faction.Value<string>("Faction");
|
||||||
long faction_bounty = faction.Value<long?>("Amount") ?? 0;
|
|
||||||
if (faction_name == null || faction_name.Length <= 0) {
|
if (faction_name == null || faction_name.Length <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Factions.Add(faction_name);
|
Factions.Add(faction_name);
|
||||||
if (!FactionBounties.ContainsKey(faction_name)) {
|
|
||||||
FactionBounties[faction_name] = 0;
|
|
||||||
}
|
|
||||||
FactionBounties[faction_name] += faction_bounty;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,16 +23,11 @@ namespace EDJournal {
|
|||||||
string single_faction = JSON.Value<string>("Faction");
|
string single_faction = JSON.Value<string>("Faction");
|
||||||
if (single_faction != null) {
|
if (single_faction != null) {
|
||||||
Factions.Add(single_faction);
|
Factions.Add(single_faction);
|
||||||
if (!FactionBounties.ContainsKey(single_faction)) {
|
|
||||||
FactionBounties[single_faction] = 0;
|
|
||||||
}
|
|
||||||
FactionBounties[single_faction] += Amount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Amount { get; set; } = 0;
|
public int Amount { get; set; } = 0;
|
||||||
public string Type { get; set; } = "Bounty";
|
public string Type { get; set; } = "Bounty";
|
||||||
public List<string> Factions { get; set; } = new List<string>();
|
public List<string> Factions { get; set; } = new List<string>();
|
||||||
public Dictionary<string, long> FactionBounties { get; set; } = new Dictionary<string, long>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user