public void SelectTargets() { HarmfulTargets = HarmfulTargetsSelector(); HarmfulTarget = HarmfulTargets.FirstOrDefault(); HelpfulTargets = HelpfulTargetsSelector(); HelpfulTarget = HelpfulTargets.FirstOrDefault(); AlternativeHelpfulTarget = HelpfulTargets.ElementAtOrDefault(1); }
public void SelectTargets() { HarmfulTargets = from u in Manager.Objects.Where(o => o.IsValid && (o.IsUnit || o.IsPlayer)).Select(o => o as WoWUnit) where u.IsValid && u.Distance < Globals.MaxDistance && !u.IsFriendly && !u.IsDead && u.IsInCombat orderby u.Distance ascending select u; HarmfulTarget = HarmfulTargets.FirstOrDefault() ?? WoWUnit.Invalid; HelpfulTargets = from u in WoWParty.Members where u.IsValid && u.Distance < Globals.MaxDistance && !u.IsDead && u.IsFriendly orderby u.HealthPercentage ascending select u; HelpfulTarget = HelpfulTargets.FirstOrDefault() ?? WoWPlayer.Invalid; AlternativeHelpfulTarget = HelpfulTargets.ElementAtOrDefault(1) ?? WoWPlayer.Invalid; }