Beispiel #1
0
        protected override async Task ActivateAsync()
        {
            RegularSimpleCard.ClearSavedList(); //just in case.

            await base.ActivateAsync();

            //go ahead and load the body anyways.  later can rethink.
            //MainVM = GetMainViewModel();
            //await LoadScreenAsync(MainVM);

            //for a game like bunco, can't show new game to start because its not alwaysnewgame.
            //if wrong, make notes and fix.

            if (AlwaysNewGame)
            {
                await ShowNewGameAsync();
            }
            if (AutoStartNewGame)
            {
                await StartNewGameAsync();
            }
            else
            {
                await OpenStartingScreensAsync();
            }
        }
        public void SortOtherCards()
        {
            DeckRegularDict <RegularSimpleCard> output = new DeckRegularDict <RegularSimpleCard>();

            _gameContainer !.OtherPlayer !.MainHandList.ForEach(thisCard =>
            {
                RegularSimpleCard newCard = new RegularSimpleCard();
                newCard.Populate(thisCard.Deck);
                newCard.IsUnknown = true;
                output.Add(newCard);
            });
            output.ShuffleList();
            _model.OpponentCards1 !.HandList.ReplaceRange(output);
        }
 async Task IFaceoffProcesses.FaceOffCardAsync(RegularSimpleCard card)
 {
     _gameContainer.SingleInfo !.FaceOff = card;
     if (_gameContainer.SingleInfo.PlayerCategory == EnumPlayerCategory.Self)
     {
         _model !.YourFaceOffCard !.AddCard(card);
     }
     else
     {
         _model !.OpponentFaceOffCard !.AddCard(card);
     }
     if (_gameContainer.PlayerList !.Any(items => items.FaceOff == null))
     {
         await _gameContainer.EndTurnAsync !.Invoke();
         return;
     }
     await AnalyzeFaceOffAsync();
 }
 public BasicGameBootstrapper(IGamePlatform customPlatform, IStartUp starts, EnumGamePackageMode mode)
 {
     BeginningColorDimensions.GraphicsHeight = 0;
     BeginningColorDimensions.GraphicsWidth  = 0;
     AssemblyLinker.ExtraViewModelLocations.Clear();
     //AssemblyLinker.ExtraViewModelLocations.Add(Assembly.GetCallingAssembly()!); //needs that too.
     AssemblyLinker.ExtraViewLocations.Clear();
     ViewLocator.ManuelVMList.Clear();
     MiscDelegates.ComputerChooseColorsAsync = null;
     MiscDelegates.ContinueColorsAsync       = null;
     MiscDelegates.FillRestColors            = null;
     MiscDelegates.GetMiscObjectsToReplace   = null;
     RegularSimpleCard.ClearSavedList();                                                               //looks like this was not good enough.
     JsonSettingsGlobals.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None; //try this way.  because otherwise, does not work if not everybody is .net core unfortunately.
     JsonSettingsGlobals.TypeNameHandling           = Newtonsoft.Json.TypeNameHandling.None;           //try this as well.  otherwise, gets hosed with .net core and xamarin forms.
     _startInfo     = starts;
     _mode          = mode;
     CustomPlatform = customPlatform;
     InitalizeAsync(); //maybe its okay to be async void.  doing the other is causing too many problems with the game package.
 }
Beispiel #5
0
        protected override async Task ActivateAsync()
        {
            RegularSimpleCard.ClearSavedList();
            GlobalHelpers.LoadGameScreenAsync = LoadGameScreenAsync;
            if (BasicData.GamePackageMode == EnumGamePackageMode.None)
            {
                throw new BasicBlankException("You need to specify whether its debug or reals");
            }
            if (BasicData.GamePackageMode == EnumGamePackageMode.Production)
            {
                if (_test.AllowAnyMove)
                {
                    throw new BasicBlankException("Can't allow any move because its production");
                }
                if (_test.AutoNearEndOfDeckBeginning)
                {
                    throw new BasicBlankException("Can't be near the end of deck at beginning because its production");
                }
                if (_test.CardsToPass != 0)
                {
                    throw new BasicBlankException("Cannot pass a special number of cards becuase its production");
                }

                if (_test.ComputerEndsTurn)
                {
                    throw new BasicBlankException("The computer cannot just end turn because its production.  Try setting another property");
                }
                if (_test.ComputerNoCards)
                {
                    throw new BasicBlankException("The computer has to have cards because its production");
                }
                if (_test.DoubleCheck)
                {
                    throw new BasicBlankException("No double checking anything because its production");
                }
                if (_test.ImmediatelyEndGame)
                {
                    throw new BasicBlankException("Cannot immediately end game because its production");
                }

                if (_test.NoAnimations)
                {
                    throw new BasicBlankException("Animations are required in production.");
                }
                if (_test.NoCommonMessages)
                {
                    throw new BasicBlankException("Must have common messages because its production");
                }
                if (_test.PlayCategory != EnumPlayCategory.Normal)
                {
                    throw new BasicBlankException("The play category must be none because its production");
                }
                if (_test.SaveOption != EnumTestSaveCategory.Normal)
                {
                    throw new BasicBlankException("The save mode must be normal because its production");
                }
                if (_test.StatePosition != 0)
                {
                    throw new BasicBlankException("Must show most recent state because its in production");
                }
                if (_test.ShowErrorMessageBoxes == false)
                {
                    throw new BasicBlankException("Must show error message boxes because its in production");
                }
                if (_test.WhoStarts != 1)
                {
                    throw new BasicBlankException("WhoStarts must start with 1 because its in production");
                }
                if (_test.ShowNickNameOnShell)
                {
                    throw new BasicBlankException("Cannot show nick name on shell because its in production");
                }
                if (_test.AlwaysNewGame)
                {
                    throw new BasicBlankException("Can't always show new game because its in production");
                }
                if (_test.EndRoundEarly)
                {
                    throw new BasicBlankException("Can't end round early because its in production");
                }
            }
            await BeforeLoadingOpeningScreenAsync();

            NickName = BasicData.NickName; //i think.
            //needs opening no matter what.
            if (CanStartWithOpenScreen)
            {
                OpeningScreen = MainContainer.Resolve <IMultiplayerOpeningViewModel>();
                await LoadScreenAsync(OpeningScreen); //so for testing purposes like three letter fun or other situations, i can more easily test.
            }
        }
 private Task OpponentCards1_ObjectClickedAsync(RegularSimpleCard payLoad, int index)
 {
     return(_process.SelectCardAsync(payLoad.Deck));
 }