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); }
public IEnumerable <SideEffect> GetSideEffects() { return(CurrentEffects.Where(t => t is SideEffect).Cast <SideEffect>()); }
public IEnumerable <PositiveEffect> GetPositiveEffects() { return(CurrentEffects.Where(e => e is PositiveEffect).Cast <PositiveEffect>()); }