Ejemplo n.º 1
0
        private void ChargerCarteNormale(int size)
        {
            Done = false;

            for (int i = 0; i < imagesPossibles.Count(); i++)
            {
                if (!imagesPossibles[i].IsUsed && !imagesPossibles[i].IsRemoved)
                {
                    do
                    {
                        int rndX = _rnd.Next(0, size);
                        int rndY = _rnd.Next(0, size);

                        if (!lstCoordUsed[rndX, rndY].IsUsed && !lstCoordUsed[rndX, rndY].IsRemoved)
                        {
                            lstImage[rndX, rndY]            = new ImageCarte();
                            lstImage[rndX, rndY].imageName  = imagesPossibles[i].imageName;
                            lstCoordUsed[rndX, rndY].IsUsed = true;
                            imagesPossibles[i].IsUsed       = true;
                            Done = true;
                        }
                    } while (!Done);
                    Done = false;
                }
            }
        }
Ejemplo n.º 2
0
        private void ChangerCarteSpecial(string carte, int size)
        {
            Done = false;

            do
            {
                int rndX = _rnd.Next(0, size);
                int rndY = _rnd.Next(0, size);

                if (!lstCoordUsed[rndX, rndY].IsUsed && !lstCoordUsed[rndX, rndY].IsRemoved)
                {
                    lstImage[rndX, rndY]               = new ImageCarte();
                    lstImage[rndX, rndY].imageName     = Directory.GetCurrentDirectory() + @"\Image\" + carte + ".png";
                    lstCoordUsed[rndX, rndY].IsUsed    = true;
                    lstCoordUsed[rndX, rndY].IsSpecial = true;
                    Done = true;
                }
            } while (!Done);
            Done = false;
        }
Ejemplo n.º 3
0
        private void ChargerCarteNormale(int size)
        {
            Done = false;

            for (int i = 0; i < imagesPossibles.Count(); i++)
            {
                if (!imagesPossibles[i].IsUsed && !imagesPossibles[i].IsRemoved)
                {
                    do
                    {
                        int rndX = _rnd.Next(0, size);
                        int rndY = _rnd.Next(0, size);

                        if (!lstCoordUsed[rndX, rndY].IsUsed && !lstCoordUsed[rndX, rndY].IsRemoved)
                        {
                            lstImage[rndX, rndY] = new ImageCarte();
                            lstImage[rndX, rndY].imageName = imagesPossibles[i].imageName;
                            lstCoordUsed[rndX, rndY].IsUsed = true;
                            imagesPossibles[i].IsUsed = true;
                            Done = true;
                        }
                    } while (!Done);
                    Done = false;
                }
            }
        }
Ejemplo n.º 4
0
        private void ChangerCarteSpecial(string carte, int size)
        {
            Done = false;

            do
            {
                int rndX = _rnd.Next(0, size);
                int rndY = _rnd.Next(0, size);

                if (!lstCoordUsed[rndX, rndY].IsUsed && !lstCoordUsed[rndX, rndY].IsRemoved)
                {
                    lstImage[rndX, rndY] = new ImageCarte();
                    lstImage[rndX, rndY].imageName = Directory.GetCurrentDirectory() + @"\Image\" + carte + ".png";
                    lstCoordUsed[rndX, rndY].IsUsed = true;
                    lstCoordUsed[rndX, rndY].IsSpecial = true;
                    Done = true;
                }
            } while (!Done);
            Done = false;
        }