public static GRGEN_LIBGR.IMatchesExact <Rule_filterBass.IMatch_filterBass> 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.ToListExact(); 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.FromListExact(); return(matches); }
public static GRGEN_LIBGR.IMatchesExact <Rule_filterHass.IMatch_filterHass> Filter_f4(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact <Rule_filterHass.IMatch_filterHass> matches, System.Int32 i, System.String s) { // inspect matches carefully and manipulate as needed, depending on input parameters // transforming to a List<IMatch> for easier manipulation and back to an IMatchesExact if needed List <Rule_filterHass.IMatch_filterHass> matchesArray = matches.ToListExact(); for (int j = 0; j < matchesArray.Count; ++j) { Rule_filterHass.IMatch_filterHass match = matchesArray[j]; if (match.node_n.i < i) { matchesArray[j] = null; // setting to null is an efficient way to delete, better than List.RemoveAt } if (match.node_n.s != s) { match.node_n.s = s; } } matches.FromListExact(); return(matches); }