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; } } }
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; }