private static void HandleCategory(KEY k, List <Regex> r, RandomizationLevel randomizationLevel) { switch (randomizationLevel) { case RandomizationLevel.None: default: break; case RandomizationLevel.Subtype: for (int i = 1; i < r.Count; i++) { List <string> temp = new List <string>(k.KeyTable.Where(x => r[i].IsMatch(x.ResRef) && !Is_Forbidden(x.ResRef) && x.ResourceType == (short)ResourceType.UTI).Select(x => x.ResRef)); Type_Lists.Add(temp); } break; case RandomizationLevel.Type: List <string> type = new List <string>(k.KeyTable.Where(x => r[0].IsMatch(x.ResRef) && !Is_Forbidden(x.ResRef) && x.ResourceType == (short)ResourceType.UTI).Select(x => x.ResRef)); Type_Lists.Add(type); break; case RandomizationLevel.Max: Max_Rando.AddRange(k.KeyTable.Where(x => r[0].IsMatch(x.ResRef) && !Is_Forbidden(x.ResRef) && x.ResourceType == (short)ResourceType.UTI).Select(x => x.ResRef)); break; } }
private static void HandleCategory(ERF e, Regex r, RandomizationLevel randomizationlevel) { switch (randomizationlevel) { default: case RandomizationLevel.None: break; // Do nothing. case RandomizationLevel.Type: List <int> type = new List <int>(e.Key_List.Where(x => r.IsMatch(x.ResRef) && !Is_Forbidden(x.ResRef)).Select(x => x.ResID)); TypeLists.Add(type); break; case RandomizationLevel.Max: MaxRando.AddRange(e.Key_List.Where(x => r.IsMatch(x.ResRef) && !Is_Forbidden(x.ResRef)).Select(x => x.ResID)); break; } }