Exemple #1
0
        protected override Task ConfigureAsync()
        {
            OurContainer !.RegisterType <BasicGameLoader <OpetongPlayerItem, OpetongSaveInfo> >();
            OurContainer.RegisterType <RetrieveSavedPlayers <OpetongPlayerItem, OpetongSaveInfo> >();
            OurContainer.RegisterType <MultiplayerOpeningViewModel <OpetongPlayerItem> >(true); //had to be set to true after all.

            OurContainer !.RegisterNonSavedClasses <OpetongMainViewModel>();
            OurContainer.RegisterSingleton <IProportionImage, SmallDrawableProportion>(ts.TagUsed);
            OurContainer.RegisterType <RegularCardsBasicShuffler <RegularRummyCard> >(true);
            OurContainer.RegisterType <DeckObservablePile <RegularRummyCard> >(true); //i think
            bool rets = OurContainer.RegistrationExist <ISortCategory>();

            if (rets == true)
            {
                ISortCategory ThisCat = OurContainer.Resolve <ISortCategory>();
                SortSimpleCards <RegularRummyCard> ThisSort = new SortSimpleCards <RegularRummyCard>();
                ThisSort.SuitForSorting = ThisCat.SortCategory;
                OurContainer.RegisterSingleton(ThisSort); //if we have a custom one, will already be picked up.
            }
            OurContainer.RegisterSingleton <IDeckCount, RegularAceLowSimpleDeck>();
            OurContainer.RegisterSingleton <IRegularAceCalculator, RegularLowAceCalculator>();

            //anything that needs to be registered will be here.
            return(Task.CompletedTask);
        }
Exemple #2
0
        protected override Task ConfigureAsync()
        {
            OurContainer !.RegisterNonSavedClasses <Spades2PlayerShellViewModel>();
            OurContainer !.RegisterType <BasicGameLoader <Spades2PlayerPlayerItem, Spades2PlayerSaveInfo> >();
            OurContainer.RegisterType <RetrieveSavedPlayers <Spades2PlayerPlayerItem, Spades2PlayerSaveInfo> >();
            OurContainer.RegisterType <MultiplayerOpeningViewModel <Spades2PlayerPlayerItem> >(true); //had to be set to true after all.
            OurContainer.RegisterType <DeckObservablePile <Spades2PlayerCardInformation> >(true);
            //OurContainer.RegisterType<GenericCardShuffler<Spades2PlayerCardInformation>>();
            OurContainer.RegisterType <RegularCardsBasicShuffler <Spades2PlayerCardInformation> >();
            OurContainer.RegisterSingleton <IRegularAceCalculator, RegularAceHighCalculator>(); //most of the time, ace is high for trick taking games.

            OurContainer.RegisterSingleton <IDeckCount, RegularAceHighSimpleDeck>();
            OurContainer.RegisterSingleton <IProportionImage, StandardProportion>(ts.TagUsed);
            //anything that needs to be registered will be here.

            bool rets = OurContainer.RegistrationExist <ISortCategory>();

            if (rets == true)
            {
                ISortCategory cat = OurContainer.Resolve <ISortCategory>();
                SortSimpleCards <Spades2PlayerCardInformation> sort = new SortSimpleCards <Spades2PlayerCardInformation>();
                sort.SuitForSorting = cat.SortCategory;
                OurContainer.RegisterSingleton(sort); //if we have a custom one, will already be picked up.
            }
            //change view model for area if not using 2 player.
            OurContainer.RegisterType <TwoPlayerTrickObservable <EnumSuitList, Spades2PlayerCardInformation, Spades2PlayerPlayerItem, Spades2PlayerSaveInfo> >();
            OurContainer.RegisterType <StandardWidthHeight>();
            return(Task.CompletedTask);
        }
        public static void RegisterCommonRegularCards <V, R>(this IGamePackageDIContainer thisContainer, bool aceLow = true, bool registerCommonProportions = true, bool customDeck = false)
            where R : IRegularCard, new()
        {
            thisContainer.RegisterNonSavedClasses <V>();

            thisContainer.RegisterType <DeckObservablePile <R> >(true);        //i think
            thisContainer.RegisterType <RegularCardsBasicShuffler <R> >(true); //if i needed a custom shuffler, rethink.
            if (registerCommonProportions == true)
            {
                thisContainer.RegisterSingleton <IProportionImage, StandardProportion>(ts.TagUsed); //so if not using common ones, then has to register that yourself.
            }
            bool rets = thisContainer.RegistrationExist <ISortCategory>();

            if (rets == true)
            {
                ISortCategory       thisCat  = thisContainer.Resolve <ISortCategory>();
                SortSimpleCards <R> thisSort = new SortSimpleCards <R>();
                thisSort.SuitForSorting = thisCat.SortCategory;
                thisContainer.RegisterSingleton(thisSort); //if we have a custom one, will already be picked up.
            }
            if (customDeck == false)
            {
                thisContainer.RegisterSingleton <IDeckCount, RegularAceHighSimpleDeck>();
                if (aceLow == true)
                {
                    thisContainer.RegisterSingleton <IRegularAceCalculator, RegularLowAceCalculator>(); //i think for now, if custom deck, then you have to manually register both.
                }
            }
        }