コード例 #1
0
        private void StartGames(object sender, RoutedEventArgs e)
        {
            List <Joueur> listPlayer = new List <Joueur>();

            listPlayer.Add(new Joueur(namePlayer1.Text, money, market));
            listPlayer.Add(new Joueur(namePlayer2.Text, money, market));
            if (Convert.ToInt32(NumberOfPlayer.SelectedValue) >= 3)
            {
                listPlayer.Add(new Joueur(namePlayer3.Text, money, market));
                if (Convert.ToInt32(NumberOfPlayer.SelectedValue) >= 4)
                {
                    listPlayer.Add(new Joueur(namePlayer4.Text, money, market));
                    if (Convert.ToInt32(NumberOfPlayer.SelectedValue) >= 5)
                    {
                        listPlayer.Add(new Joueur(namePlayer5.Text, money, market));
                        if (Convert.ToInt32(NumberOfPlayer.SelectedValue) >= 3)
                        {
                            listPlayer.Add(new Joueur(namePlayer6.Text, money, market));
                        }
                    }
                }
            }
            ReportTurn page = new ReportTurn(listPlayer, market, 15);//15 is the number of turn to modificate after

            page.Show();
            this.Close();
        }
コード例 #2
0
        private void StartGames(object sender, RoutedEventArgs e)
        {
            Random        random     = new Random();
            List <Joueur> listPlayer = new List <Joueur>();

            listPlayer.Add(new Joueur(namePlayer1.Text, money, market));
            listPlayer.Add(new Joueur(namePlayer2.Text, money, market));
            listPlayer.Add(new Joueur(namePlayer3.Text, money, market));
            listPlayer.Add(new Joueur(namePlayer4.Text, money, market));

            for (int i = 0; i < 10; i++)
            {
                int valueOfThisTurn = random.Next(-1, 3);

                market.EstimationSojuNormalSell.Add(listPlayer.Count * 90000 + i * 10000 + i * 5000 * valueOfThisTurn);
            }
            ReportTurn page = new ReportTurn(listPlayer, market, 15);//15 is the number of turn to modificate after

            page.Show();
            this.Close();
        }