Example #1
0
        private int[] cartePlayed;     //Tableau contenant le nombre de carte jouer de chaque valeur

        public Game(List <Player> p, List <Carte> s, plateau plat)
        {
            this.players     = p;
            this.sabot       = s;
            this.plateau     = plat;
            this.cartePlayed = new int[16];
        }
Example #2
0
        /// <summary>
        /// Lancement de la partie avec les paramètres selectionnés
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_menuJouer_Click(object sender, EventArgs e)
        {
            this.Hide();
            joueurs = new List <Player>();
            switch ((5 - (int)cb_nbJ.SelectedValue))
            {
            case 0:
                cartesJ = new List <Carte>();
                for (int i = 1; i <= 15; i++)
                {
                    cartesJ.Add(new Carte(i, i, Common.ColorCarte.Jaune, 0));
                }
                if (tb_IA4.Text == "")
                {
                    tb_IA4.Text = "BOT1";
                }
                IA IA4 = new IA(tb_IA4.Text, cartesJ, 0, (Common.Difficulty)cb_diffIA4.SelectedIndex);
                joueurs.Add(IA4);
                goto case 1;

            case 1:
                cartesN = new List <Carte>();
                for (int i = 1; i <= 15; i++)
                {
                    cartesN.Add(new Carte(i, i, Common.ColorCarte.Noir, 0));
                }
                if (tb_IA3.Text == "")
                {
                    tb_IA3.Text = "BOT2";
                }
                IA IA3 = new IA(tb_IA3.Text, cartesN, 0, (Common.Difficulty)cb_diffIA3.SelectedIndex);
                joueurs.Add(IA3);
                goto case 2;

            case 2:
                cartesV = new List <Carte>();
                for (int i = 1; i <= 15; i++)
                {
                    cartesV.Add(new Carte(i, i, Common.ColorCarte.Vert, 0));
                }
                if (tb_IA2.Text == "")
                {
                    tb_IA2.Text = "BOT3";
                }
                IA IA2 = new IA(tb_IA2.Text, cartesV, 0, (Common.Difficulty)cb_diffIA2.SelectedIndex);
                joueurs.Add(IA2);
                goto case 3;

            case 3:
                cartesB = new List <Carte>();
                for (int i = 1; i <= 15; i++)
                {
                    cartesB.Add(new Carte(i, i, Common.ColorCarte.Bleu, 0));
                }
                if (tb_IA1.Text == "")
                {
                    tb_IA1.Text = "BOT4";
                }
                IA IA1 = new IA(tb_IA1.Text, cartesB, 0, (Common.Difficulty)cb_diffIA1.SelectedIndex);
                joueurs.Add(IA1);
                goto case 4;

            case 4:
                cartesR = new List <Carte>();
                for (int i = 1; i <= 15; i++)
                {
                    cartesR.Add(new Carte(i, i, Common.ColorCarte.Rouge, 0));
                }
                if (tb_P1_name.Text == "")
                {
                    tb_P1_name.Text = "Player One";
                }
                Human P1 = new Human(tb_P1_name.Text, cartesR, 0);
                joueurs.Add(P1);
                break;

            default:
                break;
            }
            plateauJeu = new plateau(joueurs);
            plateauJeu.Show();
        }