public override async Task SetUpGameAsync(bool isBeginning)
        {
            LoadControls();
            if (FinishUpAsync == null)
            {
                throw new BasicBlankException("The loader never set the finish up code.  Rethink");
            }

            if (BasicData.MultiPlayer == false)
            {
                SaveRoot.Level = EnumLevel.Hard;
                IShuffleTiles tiles = MainContainer.Resolve <IShuffleTiles>();
                await tiles.StartShufflingAsync(this);
            }
            else
            {
                SaveRoot.Level    = EnumLevel.None;
                SaveRoot.CanStart = false;
                _model.PlayerWon  = "";
                await LoadStartOptionsAsync();
            }
            //hopefully will be this simple this time (?)

            await FinishUpAsync(isBeginning);
        }
        async Task IAdvancedProcesses.ChoseAdvancedOptions(bool easy, bool shortGame)
        {
            if (_basicData.Client == false)
            {
                AdvancedSettingModel model = new AdvancedSettingModel()
                {
                    IsEasy    = easy,
                    ShortGame = shortGame
                };


                await _network !.SendAllAsync("advancedsettings", model);
            }
            else if (_test.NoAnimations == false)
            {
                await _delayer.DelayMilli(500);
            }
            await _aggregator.PublishAsync(new NextScreenEventModel(EnumNextScreen.Finished));

            if (_basicData.Client == true)
            {
                _checker !.IsEnabled = true;
                return;
            }
            _mainGame.SaveRoot.ShortGame = shortGame;
            if (easy)
            {
                _mainGame.SaveRoot.Level = Data.EnumLevel.Moderate;
            }
            else
            {
                _mainGame.SaveRoot.Level = Data.EnumLevel.Hard;
            }
            await _shuffle.StartShufflingAsync(_mainGame, 0);
        }
예제 #3
0
        async Task ICardsChosenProcesses.CardsChosenAsync(int howManyCards)
        {
            if (_basicData.Client == false)
            {
                //send message to client so they can process.
                await _network !.SendAllAsync("howmanycards", howManyCards);
            }
            else if (_test.NoAnimations == false)
            {
                await _delayer.DelayMilli(300);
            }
            await _aggregator.PublishAsync(new NextScreenEventModel(EnumNextScreen.Finished));

            if (_basicData.Client == true)
            {
                _checker !.IsEnabled = true;
                return;
            }
            await _shuffle.StartShufflingAsync(_mainGame, howManyCards);
        }