コード例 #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;
                }
            }
        }
コード例 #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;
        }
コード例 #3
0
ファイル: logique.cs プロジェクト: RoaringSeagul/Memory_Game
        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;
                }
            }
        }
コード例 #4
0
ファイル: logique.cs プロジェクト: RoaringSeagul/Memory_Game
        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;
        }