private void check_Click(object sender, EventArgs e) { Moves++; if (opponent.Check(currentLocation)) { ResetGame(true); } else { RedrawForm(); } }
private void check_Click(object sender, System.EventArgs e) { _moves++; if (_opponent.Check(_currentLocation) && (_currentLocation is IHidingPlace)) { var hidingPlace = (IHidingPlace)_currentLocation; MessageBox.Show($@"You found me in {_moves} moves!"); ResetGame(); } else { description.Text = @"Not here!"; Application.DoEvents(); Thread.Sleep(2000); description.Text = _currentLocation.Description; } }