void GenerateMines() { Mines.Clear(); Random random = new Random(); while (Mines.Count < settings.MinesArea) { int minePosition = random.Next(1, settings.WidthArea * settings.HeightArea); if (!Mines.Any(m => m == minePosition)) { Mines.Add(minePosition); } } }
public bool CheckMine(Point position) { return(Mines.Any(m => m == position.X + (position.Y * settings.WidthArea))); }