public void TerminateNodes(IEnumerable <Guid> targetNodes) { HashSet <IEffectNode> nodes = new HashSet <IEffectNode>(); foreach (var targetNode in targetNodes) { nodes.AddRange(CurrentEffects.Where(x => x.Effect.TargetNodes.Any(t => t.Id.Equals(targetNode)))); } CurrentEffects.RemoveEffects(nodes); }
public void TerminateNode(Guid targetNode) { IEnumerable <IEffectNode> nodes = CurrentEffects.Where(x => x.Effect.TargetNodes.Any(t => t.Id.Equals(targetNode))).ToList(); CurrentEffects.RemoveEffects(nodes); }