private void ButtonClick(object sender, RoutedEventArgs e) { if (_cellPressOnQueue || _restartPressOnQueue) { return; } _cellPressOnQueue = true; Button button = (Button)sender; string pos = button.Name.ToString().Substring(1, 2); if (_game.CheckGameState() == 'C') { _game.UpdateBoard(pos); _game.UpdatePlayer(); PrintSymbol(pos); if (_game.BotIsPlaying) { //await Task.Delay(1500); string posBot = _game.BotTurn(); if (posBot != null) { PrintSymbol(posBot); } } } _cellPressOnQueue = false; }