private void SetConsumablesList(ParsedLog log) { List <Boon> consumableList = Boon.GetConsumableList(); long fightDuration = log.FightData.FightDuration; foreach (Boon consumable in consumableList) { foreach (CombatItem c in log.GetBoonData(consumable.ID)) { if (c.IsBuffRemove != ParseEnum.BuffRemove.None || (c.IsBuff != 18 && c.IsBuff != 1) || AgentItem.InstID != c.DstInstid) { continue; } long time = 0; if (c.IsBuff != 18) { time = log.FightData.ToFightSpace(c.Time); } if (time <= fightDuration) { Consumable existing = _consumeList.Find(x => x.Time == time && x.Item.ID == consumable.ID); if (existing != null) { existing.Stack++; } else { _consumeList.Add(new Consumable(consumable, time, c.Value)); } } } } _consumeList.Sort((x, y) => x.Time.CompareTo(y.Time)); }
private void SetConsumablesList(ParsedLog log) { List <Boon> consumableList = Boon.GetConsumableList(); long timeStart = log.FightData.FightStart; long fightDuration = log.FightData.FightEnd - timeStart; foreach (Boon consumable in consumableList) { foreach (CombatItem c in log.GetBoonData(consumable.ID)) { if (c.IsBuffRemove != ParseEnum.BuffRemove.None || (c.IsBuff != 18 && c.IsBuff != 1) || AgentItem.InstID != c.DstInstid) { continue; } long time = 0; if (c.IsBuff != 18) { time = c.Time - timeStart; } if (time <= fightDuration) { _consumeList.Add(new Tuple <Boon, long, int>(consumable, time, c.Value)); } } } _consumeList.Sort((x, y) => x.Item2.CompareTo(y.Item2)); }