Beispiel #1
0
        /// <summary>
        /// Starts the scan.
        /// </summary>
        /// <param name="args">The first argument is either the project or solution file.</param>
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("invalid argument count");
                return;
            }

            Console.WriteLine("scanning for parallelizable for loops");
            var reportFilePattern = args.Length == 2 ? args[1] : _reportFilePattern;
            var runner            = new ScanRunner(_analysisTypes, reportFilePattern, SkipTestProjects);

            runner.ScanFile(args[0]);
        }
Beispiel #2
0
 public RoutePointPool(ScanRunner runner, bool autoGenerate = true)
 {
     _runner = runner;
     if (autoGenerate)
     {
         if (_runner.IsRunning)
         {
             _runner.Finished += RunnerOnFinished;
         }
         else
         {
             Generate();
         }
     }
 }
Beispiel #3
0
        public static async Task Main(string[] args)
        {
            var currencies = (CurrencyType[])Enum.GetValues(typeof(CurrencyType));

            /*var currencies = new CurrencyType[]
             * {
             *  CurrencyType.ExaltedOrb,
             *  CurrencyType.ChaosOrb,
             *  CurrencyType.OrbOfFusing,
             *  CurrencyType.OrbOfRegret,
             *  CurrencyType.OrbOfScouring,
             * };*/
            _logger.Info("Grabbing Trade Data...");
            var trade  = new PoeTrade();
            var runner = new ScanRunner(currencies, trade, "Metamorph", 1000, 15);
            await runner.StartScan();

            _logger.Info("Building Route Pool...");
            var pool = new RoutePointPool(runner);

            _logger.Info("Waiting for pool to generate...");
            await pool.AwaitUntilGenerated();

            _logger.Info("Generated pool. Creating Route Builder...");
            var builder = new RouteBuilder(pool);

            _logger.Info("Created builder, getting routes...");
            var routes = builder.GetRoutes();

            _logger.Info("Sorting routes...");
            var sorted = routes.Where(route => route.ProfitPercent() > 1).OrderBy(route => route.ProfitPercent());

            _logger.Info("============================");
            _logger.Info("Routes");
            _logger.Info("============================");

            foreach (var route in sorted)
            {
                _logger.Info(route);
            }
        }