Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
 public bool CheckMine(Point position)
 {
     return(Mines.Any(m => m == position.X + (position.Y * settings.WidthArea)));
 }