public override List <InstantCastEvent> ComputeInstantCast(CombatData combatData, SkillData skillData, AgentData agentData) { var res = new List <InstantCastEvent>(); foreach (AgentItem playerAgent in agentData.GetAgentByType(AgentItem.AgentType.Player)) { IReadOnlyList <WeaponSwapEvent> swaps = combatData.GetWeaponSwapData(playerAgent); long lastTime = int.MinValue; foreach (WeaponSwapEvent swap in swaps) { if (swap.SwappedTo != _swappedTo) { continue; } if (swap.Time - lastTime < ICD) { lastTime = swap.Time; continue; } if (_triggerCondition != null) { if (_triggerCondition(swap, combatData, skillData)) { lastTime = swap.Time; res.Add(new InstantCastEvent(swap.Time, skillData.Get(SkillID), swap.Caster)); } } else { lastTime = swap.Time; res.Add(new InstantCastEvent(swap.Time, skillData.Get(SkillID), swap.Caster)); } } } return(res); }