public static void Filter_f3(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact <Rule_filterBass.IMatch_filterBass> matches) { // inspect matches carefully and manipulate as needed, // transforming to a List<IMatch> for easier manipulation and back to an IMatchesExact if needed List <Rule_filterBass.IMatch_filterBass> matchesArray = matches.ToList(); matchesArray.Reverse(); Rule_filterBass.IMatch_filterBass match = matchesArray[matchesArray.Count - 1]; matchesArray[matchesArray.Count - 1] = null; // setting to null is an efficient way to delete, better than List.RemoveAt ++match.node_n.i; matchesArray.Add(match); matchesArray.Reverse(); matches.FromList(); }
public static void Filter_f2(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact <Rule_filterBass.IMatch_filterBass> matches) { // inspect matches carefully and manipulate as needed IEnumerator <Rule_filterBass.IMatch_filterBass> e = matches.GetEnumeratorExact(); while (e.MoveNext()) { Rule_filterBass.IMatch_filterBass match = e.Current; if (match.node_n.i != 42) { break; } } }