Ejemplo n.º 1
0
        private async void DispatcherTimer_Tick(object sender, EventArgs e)
        {
            dispatcherTimer.Stop();
            if (gameMatch.GameMatchOutcome == GameMatchOutcome.InProgress)
            {
                await Task.Run(() =>
                {
                    gameMatch.CompleteTurn();
                });

                Board.ClearState();
                Board.SetupFromGameState(gameMatch.GameState);
                Info.UpdateFromGameMatch(gameMatch);
                dispatcherTimer.Start();
            }
            else
            {
                MessageBox.Show($"Game over in {gameMatch.TurnCount} turns: {gameMatch.GameMatchOutcome}.");
            }
        }