Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (GameModel.Instance.Ingame.IsDirty && !GameModel.Instance.Ingame.IsGameover)
        {
            if (!string.IsNullOrEmpty(GameModel.Instance.Ingame.ErrorMessage))
            {
                Action errorAction = IgCtrl.ErrorCallback;
                OneButtonPopup.Configure("Error", GameModel.Instance.Ingame.ErrorMessage, "Ok", errorAction);
                GameModel.Instance.Ingame.ErrorMessage = "";// so we don't rise it again when the next dirty state is set
                OneButtonPopup.Show();
                return;
            }

            if (GameModel.Instance.Ingame.Countdown > 0)
            {
                StartCoroutine(CountDown(GameModel.Instance.Ingame.Countdown));
                GameModel.Instance.Ingame.Countdown = -1;
            }

            if (GameModel.Instance.Ingame.Winner != 0)
            {
                Action gameOverAction = IgCtrl.GameOverCallback;
                ScoreAnimation.Show(GameModel.Instance.Ingame.Winner, GameModel.Instance.Ingame.Team, gameOverAction);
                return;
            }

            if (!string.IsNullOrEmpty(GameModel.Instance.Ingame.ConsoleResult))
            {
                StartCoroutine(ConsoleLineByLineDisplay(GameModel.Instance.Ingame.ConsoleResult));
                GameModel.Instance.Ingame.ConsoleResult = "";
            }

            GameModel.Instance.Ingame.IsDirty = false;
        }
    }
Exemple #2
0
        private async void showScore(object sender, Int32 e)
        {
            _score = new ScoreWindow();

            IEnumerable <LeaderboardEntry> entries = new List <LeaderboardEntry>();

            switch (e)
            {
            case 1:
                entries = await _store.GetLeaderboardAsync(GameTypes.TicTacToe, Scopes.AllTime);

                break;

            case 2:
                entries = await _store.GetLeaderboardAsync(GameTypes.NineMensMorris, Scopes.AllTime);

                break;

            case 3:
                entries = await _store.GetLeaderboardAsync(GameTypes.ConnectFour, Scopes.AllTime);

                break;
            }

            _scorevm             = new ScoreViewModel(entries);
            _scorevm.BackToMenu += showMainWindow;

            _score.DataContext = _scorevm;
            _score.Show();

            _window.Hide();
        }
 public static void ShowStatic()
 {
     instance.Show();
 }