예제 #1
0
        public SimulationSummary BulkSimulate(IPlayer player, IEnemy enemy)
        {
            List <Task> tasks      = new List <Task>();
            int         numThreads = numSims / numSimsPerThread;

            for (int i = 0; i < numThreads; i++)
            {
                tasks.Add(BuildSimTask(rng.Copy(), player, enemy.Copy()));
            }

            tasks.ForEach(x => x.Wait());

            IEnumerable <SimulationSummary> flattenedSimsList = sims.SelectMany(x => x);

            return(Condense(flattenedSimsList));
        }