public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log) { foreach (BoonSimulationItemDuration item in _stacks) { item.SetBoonDistributionItem(distribs, start, end, boonid, log); } }
private void SetBuffs(ParsedLog log) { _buffs = new List <Dictionary <long, FinalTargetBuffs> >(); List <PhaseData> phases = log.FightData.GetPhases(log); for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++) { BoonDistribution boonDistribution = GetBoonDistribution(log, phaseIndex); Dictionary <long, FinalTargetBuffs> rates = new Dictionary <long, FinalTargetBuffs>(); _buffs.Add(rates); Dictionary <long, long> buffPresence = GetBuffPresence(log, phaseIndex); PhaseData phase = phases[phaseIndex]; long fightDuration = phase.DurationInMS; foreach (Boon boon in TrackedBoons) { if (boonDistribution.ContainsKey(boon.ID)) { FinalTargetBuffs buff = new FinalTargetBuffs(log.PlayerList); rates[boon.ID] = buff; if (boon.Type == Boon.BoonType.Duration) { buff.Uptime = Math.Round(100.0 * boonDistribution.GetUptime(boon.ID) / fightDuration, GeneralHelper.BoonDigit); foreach (Player p in log.PlayerList) { long gen = boonDistribution.GetGeneration(boon.ID, p.AgentItem); buff.Generated[p] = Math.Round(100.0 * gen / fightDuration, GeneralHelper.BoonDigit); buff.Overstacked[p] = Math.Round(100.0 * (boonDistribution.GetOverstack(boon.ID, p.AgentItem) + gen) / fightDuration, GeneralHelper.BoonDigit); buff.Wasted[p] = Math.Round(100.0 * boonDistribution.GetWaste(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.UnknownExtension[p] = Math.Round(100.0 * boonDistribution.GetUnknownExtension(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.Extension[p] = Math.Round(100.0 * boonDistribution.GetExtension(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.Extended[p] = Math.Round(100.0 * boonDistribution.GetExtended(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); } } else if (boon.Type == Boon.BoonType.Intensity) { buff.Uptime = Math.Round((double)boonDistribution.GetUptime(boon.ID) / fightDuration, GeneralHelper.BoonDigit); foreach (Player p in log.PlayerList) { long gen = boonDistribution.GetGeneration(boon.ID, p.AgentItem); buff.Generated[p] = Math.Round((double)gen / fightDuration, GeneralHelper.BoonDigit); buff.Overstacked[p] = Math.Round((double)(boonDistribution.GetOverstack(boon.ID, p.AgentItem) + gen) / fightDuration, GeneralHelper.BoonDigit); buff.Wasted[p] = Math.Round((double)boonDistribution.GetWaste(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.UnknownExtension[p] = Math.Round((double)boonDistribution.GetUnknownExtension(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.Extension[p] = Math.Round((double)boonDistribution.GetExtension(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); buff.Extended[p] = Math.Round((double)boonDistribution.GetExtended(boon.ID, p.AgentItem) / fightDuration, GeneralHelper.BoonDigit); } if (buffPresence.TryGetValue(boon.ID, out long presenceValueBoon)) { buff.Presence = Math.Round(100.0 * presenceValueBoon / fightDuration, GeneralHelper.BoonDigit); } } } } } }
protected Dictionary <AgentItem, BoonDistributionItem> GetDistrib(BoonDistribution distribs, long boonid) { if (!distribs.TryGetValue(boonid, out var distrib)) { distrib = new Dictionary <AgentItem, BoonDistributionItem>(); distribs.Add(boonid, distrib); } return(distrib); }
public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log) { Dictionary <AgentItem, BoonDistributionItem> distrib = GetDistrib(distribs, boonid); AgentItem agent = Src; if (distrib.TryGetValue(agent, out var toModify)) { toModify.Overstack += GetValue(start, end); distrib[agent] = toModify; } else { distrib.Add(agent, new BoonDistributionItem( 0, GetValue(start, end), 0, 0, 0, 0)); } }
public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log) { Dictionary <AgentItem, BoonDistributionItem> distrib = GetDistrib(distribs, boonid); long cDur = GetClampedDuration(start, end); AgentItem agent = _src; AgentItem seedAgent = _seedSrc; if (distrib.TryGetValue(agent, out BoonDistributionItem toModify)) { toModify.Value += cDur; distrib[agent] = toModify; } else { distrib.Add(agent, new BoonDistributionItem( cDur, 0, 0, 0, 0, 0)); } if (_isExtension) { if (distrib.TryGetValue(agent, out toModify)) { toModify.Extension += cDur; distrib[agent] = toModify; } else { distrib.Add(agent, new BoonDistributionItem( 0, 0, 0, 0, cDur, 0)); } } if (agent != seedAgent) { if (distrib.TryGetValue(seedAgent, out toModify)) { toModify.Extended += cDur; distrib[seedAgent] = toModify; } else { distrib.Add(seedAgent, new BoonDistributionItem( 0, 0, 0, 0, 0, cDur)); } } if (agent == GeneralHelper.UnknownAgent) { if (distrib.TryGetValue(seedAgent, out toModify)) { toModify.UnknownExtension += cDur; distrib[seedAgent] = toModify; } else { distrib.Add(seedAgent, new BoonDistributionItem( 0, 0, 0, cDur, 0, 0)); } } }
public abstract void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log);