public void SelectBlock(int?x, int?y) { if (CurrentState == GameState.GameOver) { return; } if (x.HasValue && y.HasValue) { if (Board[y.Value, x.Value] != null && Board[y.Value, x.Value] != SelectedBlock) { SoundBoard.PlayBlockSelect(); } SelectedBlock = Board[y.Value, x.Value]; if ((Board[y.Value, x.Value] == null || Board[y.Value, x.Value].IsPending)) { x = null; y = null; SelectedBlock = null; } } else { SelectedBlock = null; } selectedX = x; selectedY = y; for (int r = 0; r < Rows; r++) { for (int c = 0; c < Cols; c++) { if (r == y && c == x) { Tiles[r, c].SetSelectedCell(); } else if (r == y || c == x) { Tiles[r, c].SetSelectedRowCol(); } else { Tiles[r, c].SetUnselected(); } } } ShowAndHideArrows(); }