private void GameWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { NotifyPropertyChanged("IsGameInProgress"); OrangePlayer.OnGameEnd(GameState); VioletPlayer.OnGameEnd(GameState); ShowGameResult(); if (e.Error != null) { MessageBox.Show(e.Error.ToString()); } }
private void NewTraining() { if (_Worker == null || !_Worker.IsBusy) { IsVioletWinner = false; IsOrangeWinner = false; GameState = new GameState() { OrangePlayer = this.OrangePlayer, VioletPlayer = this.VioletPlayer }; RefreshUI(); OrangePlayer.OnGameStart(GameState); VioletPlayer.OnGameStart(GameState); StartGameTrainer(); } else { CurrentPlayer.CancelMove(GameState); _Worker.CancelAsync(); } }