public void Apply(SimGameState simGame) { var visitedSystems = Traverse.Create(simGame).Field("VisitedStarSystems").GetValue <List <string> >(); foreach (var system in visitedSystems) { MapModesUI.DimSystem(system, _dimLevel); } }
private void ApplyFilter(SimGameState simGame, string searchString) { searchString = searchString.ToLower(); var andSplit = searchString.Split('&'); var searchTree = andSplit.Select(andTerm => andTerm.Split('|').Select(orTerm => new SearchValue(orTerm)).ToArray()).ToArray(); foreach (var systemID in simGame.StarSystemDictionary.Keys) { var system = simGame.StarSystemDictionary[systemID]; var matches = searchTree.All(andTerm => andTerm.Any(searchValue => DoesSystemMatchSearch(system, searchValue))); // dim level of 1 means it should "stay" the reg system color MapModesUI.DimSystem(systemID, matches ? 1 : _dimLevel); } }