public void SetSearchPatterns() { SearchPatterns.Clear(); foreach (var searchTerm in ForbiddenMethods) { SearchPatterns.Add(searchTerm, $"Enumerable.{searchTerm}({_root.Identifier})"); } }
public void SetSearchPatterns() { SearchPatterns.Clear(); foreach (var searchTerm in ForbiddenMethods) { SearchPatterns.Add(searchTerm, $"{_root}.{searchTerm}()"); } }
void EnumerateLocationsByType(SearchPatterns pattern) { locationNames.Clear(); if (regionData.LocationCount == 0) ReloadCurrentRegion(); for (int i = 0; i < regionData.LocationCount; i++) { bool addName = false; DFRegion.LocationTypes type = regionData.MapTable[i].LocationType; switch (pattern) { case SearchPatterns.All: addName = true; break; case SearchPatterns.Cities: if (type == DFRegion.LocationTypes.TownCity || type == DFRegion.LocationTypes.TownHamlet || type == DFRegion.LocationTypes.TownVillage) { addName = true; } break; case SearchPatterns.Dungeons: if (type == DFRegion.LocationTypes.DungeonKeep || type == DFRegion.LocationTypes.DungeonLabyrinth || type == DFRegion.LocationTypes.DungeonRuin) { addName = true; } break; case SearchPatterns.Graveyards: if (type == DFRegion.LocationTypes.GraveyardCommon || type == DFRegion.LocationTypes.GraveyardForgotten) { addName = true; } break; case SearchPatterns.Homes: if (type == DFRegion.LocationTypes.HomeFarms || type == DFRegion.LocationTypes.HomePoor || type == DFRegion.LocationTypes.HomeWealthy || type == DFRegion.LocationTypes.HomeYourShips) { addName = true; } break; case SearchPatterns.Taverns: if (type == DFRegion.LocationTypes.Tavern) { addName = true; } break; case SearchPatterns.Temples: if (type == DFRegion.LocationTypes.ReligionCoven || type == DFRegion.LocationTypes.ReligionCult || type == DFRegion.LocationTypes.ReligionTemple) { addName = true; } break; } if (addName) locationNames.Add(regionData.MapNames[i]); } locationNames.Sort(); }
void EnumerateLocationsByType(SearchPatterns pattern) { locationNames.Clear(); if (regionData.LocationCount == 0) { ReloadCurrentRegion(); } for (int i = 0; i < regionData.LocationCount; i++) { bool addName = false; DFRegion.LocationTypes type = regionData.MapTable[i].LocationType; switch (pattern) { case SearchPatterns.All: addName = true; break; case SearchPatterns.Cities: if (type == DFRegion.LocationTypes.TownCity || type == DFRegion.LocationTypes.TownHamlet || type == DFRegion.LocationTypes.TownVillage) { addName = true; } break; case SearchPatterns.Dungeons: if (type == DFRegion.LocationTypes.DungeonKeep || type == DFRegion.LocationTypes.DungeonLabyrinth || type == DFRegion.LocationTypes.DungeonRuin) { addName = true; } break; case SearchPatterns.Graveyards: if (type == DFRegion.LocationTypes.GraveyardCommon || type == DFRegion.LocationTypes.GraveyardForgotten) { addName = true; } break; case SearchPatterns.Homes: if (type == DFRegion.LocationTypes.HomeFarms || type == DFRegion.LocationTypes.HomePoor || type == DFRegion.LocationTypes.HomeWealthy || type == DFRegion.LocationTypes.HomeYourShips) { addName = true; } break; case SearchPatterns.Taverns: if (type == DFRegion.LocationTypes.Tavern) { addName = true; } break; case SearchPatterns.Temples: if (type == DFRegion.LocationTypes.ReligionCoven || type == DFRegion.LocationTypes.ReligionCult || type == DFRegion.LocationTypes.ReligionTemple) { addName = true; } break; } if (addName) { locationNames.Add(regionData.MapNames[i]); } } locationNames.Sort(); }