コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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;
            }
        }
コード例 #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;
            }
        }
コード例 #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);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
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);
            }
        }