示例#1
0
    // Use this for initialization

    public static void rollDice()
    {
        int        r = Random.Range(0, diceInPyramid.Count);
        GameObject d = diceInPyramid [r];

        diceInPyramid.RemoveAt(r);
        DiceLauncher.createDice(d);
    }
示例#2
0
        private int CalculerFrais()
        {
            Lancer l = DiceLauncher.LancerDes();

            int frais = l.First * 4;

            if (plateau.VerifCompagniesPossedeesPar(this.proprietaire))
            {
                frais = l.First * 10;
            }
            return(frais);
        }
示例#3
0
        public bool JouerTour()
        {
            //Lancer les dés
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"------------------- {nom} joue son tour -------------------");
            Thread.Sleep(10);
            Console.ResetColor();
            Console.WriteLine($"{nom} a {argent}M$ sur son compte.\n");
            Lancer lancer;

            do
            {
                lancer = DiceLauncher.LancerDes();

                //Avancer(lancer.First); //truc avant test

                //==================== TEST
                //Choisir de combien faire avancer le dé
                Console.WriteLine("Choisir la valeur du dé :");
                int nbDice = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Est-ce un double ? [Y/N]");
                string choice = Console.ReadLine().ToLower();

                //lancer.Second = choice == "y" ? true , false;
                if (choice == "y")
                {
                    lancer.Second = true;
                }
                else
                {
                    lancer.Second = false;
                }
                Avancer(nbDice);

                //==================== fin test


                if (lancer.Second)
                {
                    Console.WriteLine("Vous avez fait un double, vous rejouez !");
                }
            } while (lancer.Second);

            return(VerifDefaite());
        }
示例#4
0
        private int CalculerFrais()
        {
            Lancer l = DiceLauncher.LancerDes();

            int frais;

            if (plateau.VerifCompagniesPossedeesPar(this.proprietaire))
            {
                frais = l.First * 10;
            }
            else
            {
                frais = l.First * 4;
            }

            Console.WriteLine($"Nouveau lancer de dés pour le calcul des frais : {l.First}");
            return(frais);
        }
示例#5
0
        public bool JouerTour()
        {
            //Lancer les d�s
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"------------------- {nom} joue son tour -------------------");
            Thread.Sleep(10);
            Console.ResetColor();
            Console.WriteLine($"{nom} a {argent}M$ sur son compte et est sur la case {position.nom}.\n");
            Lancer lancer;

            do
            {
                lancer = DiceLauncher.LancerDes();

                //Avancer(lancer.First); //truc avant test

                //==================== TEST
                //Choisir de combien faire avancer le d�
                Console.WriteLine("Choisir la valeur du dé :");
                int nbDice = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Est-ce un double ? [Y/N]");
                string choice = Console.ReadLine().ToLower();

                //lancer.Second = choice == "y" ? true , false;
                if (choice == "y")
                {
                    lancer.Second = true;
                }
                else
                {
                    lancer.Second = false;
                }
                Avancer(nbDice);

                //==================== fin test


                if (lancer.Second)
                {
                    Console.WriteLine("Vous avez fait un double, vous rejouez !");
                }
            } while (lancer.Second);

            Terrain terrainChoisi;

            do
            {
                //terrainChoisi = plateau.AfficheCasesConstructiblesEtChoixTerrain(this);
                terrainChoisi = AfficheCasesConstructiblesEtChoixTerrain();
                if (terrainChoisi != null)
                {
                    int nbMaisonsAConstruire = ChoisirNbMaisons(terrainChoisi);
                    if (!(nbMaisonsAConstruire <= 0))
                    {
                        terrainChoisi.Construire(nbMaisonsAConstruire);
                    }
                }
            } while (terrainChoisi != null);
            //Affiches Cases constructibles s'il y en a

            return(VerifDefaite());
        }