public static void updateLootCounts(RequestListItem requestListItem) { if (lootCountsByName.ContainsKey(requestListItem.Player)) { LootCounts counts = lootCountsByName[requestListItem.Player]; requestListItem.Main = counts.Main; requestListItem.Alt = counts.Alt; requestListItem.Days = counts.LastMainDays; } }
private static void populateLootCounts(List <Dictionary <string,string> > lootedSubList,DateTime start) { foreach (Dictionary <string,string> row in lootedSubList) { LootCounts counts; string name; if (row.ContainsKey(NAME) && ((name = row[NAME]) != null)) { if (lootCountsByName.ContainsKey(name)) { counts = lootCountsByName[name]; } else { counts = new LootCounts { Main = 0,Alt = 0,LastMainDays = -1 }; lootCountsByName.Add(name,counts); } if (row.ContainsKey(ALT_LOOT) && "Yes".Equals(row[ALT_LOOT],StringComparison.OrdinalIgnoreCase)) { counts.Alt++; } else if (!row.ContainsKey(ROT) || !"Yes".Equals(row[ROT],StringComparison.OrdinalIgnoreCase)) { counts.Main++; int days = Convert.ToInt32((start - System.DateTime.Parse(row[DATE])).TotalDays); if (counts.LastMainDays == -1 || counts.LastMainDays > days) { counts.LastMainDays = days; } } } } }