/// <summary> /// Начало новой игры /// </summary> /// <param name="level">Уровень игры</param> private void StartNewGame(Level level) { Score = 0; _level = level; WordTb.Focus(); GameProcess(); }
/// <summary> /// Метод обработки ввода слов /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void WordTb_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { var entered = WordTb.Text; var goalShips = _shipObjects.Keys.Where(s => s.IsEnabled && s.Word.Answer.ToLower() == entered.ToLower()).ToList(); Shoot(goalShips.FirstOrDefault()); WordTb.Clear(); } }