public List <FinalPlayerSupport> GetPlayerSupport(ParsedEvtcLog log) { if (_playerSupport == null) { _playerSupport = new List <FinalPlayerSupport>(); List <PhaseData> phases = log.FightData.GetPhases(log); for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++) { var playerSup = new FinalPlayerSupport(); _playerSupport.Add(playerSup); FinalSupportAll totals = GetSupport(log, phaseIndex); playerSup.Resurrects = totals.Resurrects; playerSup.ResurrectTime = Math.Round(totals.ResurrectTime / 1000.0, ParserHelper.TimeDigit); FinalSupport self = GetSupport(log, this, phaseIndex); foreach (Buff boon in log.Buffs.BuffsByNature[BuffNature.Boon]) { // add everything from total if (totals.Removals.TryGetValue(boon.ID, out (int count, long time)item)) { playerSup.BoonStrips += item.count; playerSup.BoonStripsTime += item.time; } // remove everything from self if (self.Removals.TryGetValue(boon.ID, out item)) { playerSup.BoonStrips -= item.count; playerSup.BoonStripsTime -= item.time; } } foreach (Buff condition in log.Buffs.BuffsByNature[BuffNature.Condition]) { // add everything from self if (self.Removals.TryGetValue(condition.ID, out (int count, long time)item)) { playerSup.CondiCleanseSelf += item.count; playerSup.CondiCleanseTimeSelf += item.time; } foreach (Player p in log.PlayerList) { if (p == this) { continue; } FinalSupport other = GetSupport(log, p, phaseIndex); // Add everything from other if (other.Removals.TryGetValue(condition.ID, out item)) { playerSup.CondiCleanse += item.count; playerSup.CondiCleanseTime += item.time; } } } playerSup.CondiCleanseTime = Math.Round(playerSup.CondiCleanseTime / 1000.0, ParserHelper.TimeDigit); playerSup.CondiCleanseTimeSelf = Math.Round(playerSup.CondiCleanseTimeSelf / 1000.0, ParserHelper.TimeDigit); playerSup.BoonStripsTime = Math.Round(playerSup.BoonStripsTime / 1000.0, ParserHelper.TimeDigit); } } return(_playerSupport); }
// Public methods public FinalPlayerSupport GetPlayerSupportStats(ParsedEvtcLog log, long start, long end) { if (_playerSupportStats == null) { _playerSupportStats = new CachingCollection <FinalPlayerSupport>(log); } if (!_playerSupportStats.TryGetValue(start, end, out FinalPlayerSupport value)) { value = new FinalPlayerSupport(log, this, start, end); _playerSupportStats.Set(start, end, value); } return(value); }