private void LoseGame() { foreach (Button button in buttons) { Cell correspondingCell = cells.Find(c => c.getXY() == (button.Location.X + " " + button.Location.Y)); if (correspondingCell.isMine()) { button.Text = "💣"; button.ForeColor = Color.Red; } correspondingCell.MakeVisible(); } ChangeStatus(Status.Lost); }
private void NumberCell(Button current, Cell currentCell) { int surroundingMines = currentCell.getNumber(); currentCell.MakeVisible(); if (surroundingMines == 0) { current.BackColor = Color.BlanchedAlmond; current.Text = " "; } else { current.BackColor = Color.AntiqueWhite; current.Text = surroundingMines + ""; } current.ForeColor = Color.Blue; }