/// <summary> /// Randomly places mines on tiles. /// </summary> private void AssignMines( ) { List <GridCoordinates> minesCoordinates = new List <GridCoordinates> ( ); GridCoordinates tempCoordinates; for (int i = 0; i < _model._numberOfBombs; i++) { do { tempCoordinates = GetRandomGridCoordinates( ); } while (minesCoordinates.Contains(tempCoordinates)); minesCoordinates.Add(tempCoordinates); } foreach (GridCoordinates gc in minesCoordinates) { _view.AssignTileAsMine(gc); } }