public static bool select <T>(ref int no, Countless <T> tree) { List <int> inds; List <T> objs = tree.GetAllObjs(out inds); List <string> filtered = new List <string>(); int tmpindex = -1; for (int i = 0; i < objs.Count; i++) { if (no == inds[i]) { tmpindex = i; } filtered.Add(objs[i].ToPEGIstring()); } if (select(ref tmpindex, filtered.ToArray())) { no = inds[tmpindex]; return(true); } return(false); }
public static bool select <T>(ref int no, Countless <T> tree) { List <int> indexes; var objs = tree.GetAllObjs(out indexes); var filtered = new List <string>(); var current = -1; for (var i = 0; i < objs.Count; i++) { if (no == indexes[i]) { current = i; } filtered.Add(objs[i].ToPegiString()); } if (select(ref current, filtered.ToArray())) { no = indexes[current]; return(true); } return(false); }