Ejemplo n.º 1
0
        async Task IHandleAsync <GameOverEventModel> .HandleAsync(GameOverEventModel message)
        {
            CommandContainer.ClearLists(); //try this too.
            if (MainVM == null)
            {
                throw new BasicBlankException("The main view model was not even available.  Rethink");
            }
            await _saves.DeleteSinglePlayerGameAsync(); //just in case its forgotten, it will be deleted.

            await CloseSpecificChildAsync(MainVM);

            MainVM = null;
            if (NewGameVM != null)
            {
                return;
            }
            await GameOverScreenAsync();

            if (AutoStartNewGame == false)
            {
                await OpenStartingScreensAsync();
            }
            else
            {
                await ShowNewGameAsync(); //try this way (?)
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// this is when the game is over.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        async Task IHandleAsync <GameOverEventModel> .HandleAsync(GameOverEventModel message) //done.
        {
            //i propose just having the extra button for new game that appears when the game is over.
            CommandContainer.ClearLists(); //try this too.
            ReplaceGame();                 //i think here it should replace the game. not so for rounds.
            //replacegame is where the problem is at.  for clients, that seems to happen as well.
            if (BasicData.MultiPlayer == true && BasicData.Client == true)
            {
                return; //because only host can choose new game unless its single player game.
            }
            await _save.DeleteGameAsync();

            if (MainVM == null)
            {
                throw new BasicBlankException("The main view model was not even available.  Rethink");
            }

            //get it fresh now.
            //this is one case where i have to replace the game.
            //also think about what else has to be replaced.

            //if there are other things that needs to be replaced that does not depend on the game processes, do here.

            //host has to decide if he even wants new game.
            if (_test.AlwaysNewGame)
            {
                //has to close so it can refresh agin.
                await CloseSpecificChildAsync(NewGameScreen !);

                NewGameScreen = null; //has to do again.  that is the best way to handle so i can click new game.
            }
            await ShowNewGameAsync();
        }