private async Task PlayGameAsync(GameHistoryEntryViewModel gameHistoryEntry) { RoundResult result; do { result = await Game.PerformNextRoundAsync(); OutputText += result.OutputText; foreach (var roundPartialHistory in result.History) { gameHistoryEntry.History.Add(roundPartialHistory); } } while (!result.IsFinished && IsGameInProgress && !IsGamePaused); if (result.IsFinished && IsGameInProgress) { await MakeEndGameConfiguration(result); } }
public async Task PlayNextGameAsync() { var nextCompetitors = Elimination.GetNextCompetitors(); GameOverTextVisibility = Visibility.Collapsed; if (nextCompetitors != null) { var gameHistoryEntry = new GameHistoryEntryViewModel() { GameDescription = Elimination.GetGameDescription(), History = new ObservableCollection <RoundPartialHistory>() }; Game.SetupNewGame(nextCompetitors); GameHistory.Add(gameHistoryEntry); OutputText += "Game starting: " + gameHistoryEntry.GameDescription + "\n"; await PlayGameAsync(gameHistoryEntry); } }
public async Task PlayNextGameAsync() { var nextCompetitors = Elimination.GetNextCompetitors(); if (nextCompetitors != null) { await SetArenaMessage(ArenaMessageHelper.GetInitialMessage(nextCompetitors)); var gameHistoryEntry = new GameHistoryEntryViewModel() { GameDescription = Elimination.GetGameDescription(), History = new ObservableCollection <RoundPartialHistory>() }; Game.SetupNewGame(nextCompetitors); GameHistory.Add(gameHistoryEntry); OutputText += "Game starting: " + gameHistoryEntry.GameDescription + "\n"; await PlayGameAsync(gameHistoryEntry); } }
private async Task PlayGameAsync(GameHistoryEntryViewModel gameHistoryEntry) { RoundResult result; do { result = await Game.PerformNextRoundAsync(); OutputText += result.OutputText; foreach (var roundPartialHistory in result.History) { gameHistoryEntry.History.Add(roundPartialHistory); } } while (!result.IsFinished && IsGameInProgress && !IsGamePaused); if (result.IsFinished) { Elimination.SetLastDuelResult(result.FinalResult); ScoreList.SaveScore(result.FinalResult); GameOverTextVisibility = Visibility.Visible; } }
public async Task PlayNextGameAsync() { var nextCompetitors = Elimination.GetNextCompetitors(); GameOverTextVisibility = Visibility.Collapsed; if (nextCompetitors != null) { var gameHistoryEntry = new GameHistoryEntryViewModel() { GameDescription = Elimination.GetGameDescription(), History = new ObservableCollection<RoundPartialHistory>() }; Game.SetupNewGame(nextCompetitors); GameHistory.Add(gameHistoryEntry); OutputText += "Game starting: " + gameHistoryEntry.GameDescription + "\n"; await PlayGameAsync(gameHistoryEntry); } }
public async Task PlayNextGameAsync() { var nextCompetitors = Elimination.GetNextCompetitors(); if (nextCompetitors != null) { await SetArenaMessage(ArenaMessageHelper.GetInitialMessage(nextCompetitors)); var gameHistoryEntry = new GameHistoryEntryViewModel() { GameDescription = Elimination.GetGameDescription(), History = new ObservableCollection<RoundPartialHistory>() }; Game.SetupNewGame(nextCompetitors); GameHistory.Add(gameHistoryEntry); OutputText += "Game starting: " + gameHistoryEntry.GameDescription + "\n"; await PlayGameAsync(gameHistoryEntry); } }