예제 #1
0
        private void btn_Test_Click(object sender, EventArgs e)
        {
            List <Player> players = DataAccess.Instance.GetPlayers("Active = 1");

            players.Sort(new PointsComparator());

            MyMax max = new MyMax();

            max.MAX = 0;
            int x = -1;

            foreach (Player p in players)
            {
                ProcessThread pt = new ProcessThread()
                {
                    Max        = max,
                    Deck       = players,
                    StartIndex = x++
                };
                Thread thread = new Thread(pt.RunAlgorithm)
                {
                    Name     = "StartIndex: " + x,
                    Priority = ThreadPriority.Lowest
                };
                thread.Start();
            }

            Console.Write("Done");
        }
예제 #2
0
        private void btn_Test_Click(object sender, EventArgs e)
        {
            List<Player> players = DataAccess.Instance.GetPlayers("Active = 1");
            players.Sort(new PointsComparator());

            MyMax max = new MyMax();
            max.MAX = 0;
            int x = -1;
            foreach (Player p in players)
            {
                ProcessThread pt = new ProcessThread()
                {
                    Max = max,
                    Deck = players,
                    StartIndex = x++
                };
                Thread thread = new Thread(pt.RunAlgorithm)
                {
                    Name = "StartIndex: " + x,
                    Priority = ThreadPriority.Lowest
                };
                thread.Start();
            }

            Console.Write("Done");
        }