Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
        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();
            
            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);
            }
        }