public List <int> Get1SDamageList(ParsedLog log, int phaseIndex, PhaseData phase, AbstractActor target) { ulong targetId = target != null ? target.Agent : 0; int id = (phaseIndex + "_" + targetId + "_1S").GetHashCode(); if (DamageList1S.TryGetValue(id, out List <int> res)) { return(res); } List <int> dmgList = new List <int>(); List <DamageLog> damageLogs = GetDamageLogs(target, log, phase.Start, phase.End); // fill the graph, full precision List <int> dmgListFull = new List <int>(); for (int i = 0; i <= phase.GetDuration(); i++) { dmgListFull.Add(0); } int totalTime = 1; int totalDamage = 0; foreach (DamageLog dl in damageLogs) { int time = (int)(dl.Time - phase.Start); // fill for (; totalTime < time; totalTime++) { dmgListFull[totalTime] = totalDamage; } totalDamage += dl.Damage; dmgListFull[totalTime] = totalDamage; } // fill for (; totalTime <= phase.GetDuration(); totalTime++) { dmgListFull[totalTime] = totalDamage; } // dmgList.Add(0); for (int i = 1; i <= phase.GetDuration("s"); i++) { dmgList.Add(dmgListFull[1000 * i]); } if (phase.GetDuration("s") * 1000 != phase.GetDuration()) { int lastDamage = dmgListFull[(int)phase.GetDuration()]; dmgList.Add(lastDamage); } DamageList1S[id] = dmgList; return(dmgList); }
public List <DamageLog> GetJustPlayerDamageLogs(AbstractActor target, ParsedLog log, long start, long end) { return(GetDamageLogs(target, log, start, end).Where(x => x.SrcInstId == AgentItem.InstID).ToList()); }