static async Task Scan(string originSystem, int scanRadius, bool plotJourney, bool includeBodies, TimeSpan cacheDuration, string[] filterSystem, string[] filterBody) { using var client = new EdsmClient(new SystemCache(cacheDuration)); var foundSystems = await new SystemResolver(client).ResolveSystemsAround(originSystem, scanRadius); var filteredSystems = new SystemFilter(filterSystem, filterBody).Filter(foundSystems); var remainingSystems = foundSystems.Except(filteredSystems).ToArray(); await new VisitedSystemIdsWriter().WriteVisitedSystems(originSystem, remainingSystems); var orderedPartialSystems = new SystemOrderer(filteredSystems, plotJourney).Order(); await new SystemListWriter().WriteSystemList(originSystem, orderedPartialSystems, includeBodies, plotJourney); }
public SystemResolver(EdsmClient client) { _client = client; }