Exemple #1
0
 public bool DidWin(CustomBasicList <CustomBasicList <C> > comboList)
 {
     foreach (var currentCombo in comboList)
     {
         if (currentCombo.All(Temps => Temps.IsFilled()) == true)
         {
             object searchObject = MainObjectSelector !.Invoke(currentCombo.First());
             bool   allTrue      = true;
             object compareObject;
             foreach (var item in currentCombo)
             {
                 compareObject = MainObjectSelector.Invoke(item);
                 if (compareObject.Equals(searchObject) == false) //try this way.
                 {
                     allTrue = false;
                     break;
                 }
             }
             if (allTrue == true)
             {
                 return(true);
             }
         }
     }
     ;
     return(false); //if you can't prove a win, then you did not win.
 }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Carpet Solitaire", "Clock Solitaire", "Cribbage Patience", "Eagle Wings Solitaire", "Easy Go Solitaire", "Heap Solitaire", "Triangle Solitaire", "Vegas Solitaire"
     };
 }
Exemple #3
0
        public void FillInYears(BasicPlayListData currentObj, ref CustomBasicList <ICondition> tempList, ref bool hadOne,
                                Action <CustomBasicList <ICondition> >?action = null) //i think needs to be here so its flexible of when its called.
        {
            if (currentObj.EarliestYear > 0)
            {
                if (currentObj.EarliestYear > currentObj.LatestYear && currentObj.LatestYear > 0)
                {
                    throw new BasicBlankException("The latest year must be greater or equal to the earliest year");
                }

                hadOne = true;
                if (currentObj.LatestYear > 0)
                {
                    tempList.AppendRangeCondition(nameof(IBaseSong.YearSong), currentObj.EarliestYear, currentObj.LatestYear);
                }
                else
                {
                    tempList.AppendCondition(nameof(IBaseSong.YearSong), cs.Equals, currentObj.EarliestYear);
                }

                if (action != null)
                {
                    action.Invoke(tempList);
                }
            }
        }
Exemple #4
0
        private async Task CreateSetsAsync(string message)
        {
            var firstTemp = await js.DeserializeObjectAsync <CustomBasicList <string> >(message);

            SingleInfo = PlayerList !.GetWhoPlayer(); //trying this as well.
            foreach (var thisFirst in firstTemp)
            {
                CustomBasicList <int> thisCol = await js.DeserializeObjectAsync <CustomBasicList <int> >(thisFirst);

                thisCol.ForEach(deck =>
                {
                    CustomBasicList <int> otherList = SingleInfo.MainHandList.GetDeckListFromObjectList();
                    string thisstr = "";
                    otherList.ForEach(thisItem =>
                    {
                        thisstr += thisItem + ",";
                    });
                    if (SingleInfo.MainHandList.ObjectExist(deck) == false)
                    {
                        throw new BasicBlankException($"Deck of {deck} does not exist.  Player Is {SingleInfo.NickName}. ids are {thisstr} ");
                    }
                });
                var ThisCol = await thisFirst.GetObjectsFromDataAsync(SingleInfo.MainHandList);

                AddSet(ThisCol);
            }
        }
        public static CustomBasicList <string> GetSalaryList(this CustomBasicList <LifeBoardGamePlayerItem> tempList)
        {
            CustomBasicList <string> output = new CustomBasicList <string>();

            tempList.ForConditionalItems(items => items.Salary > 0, thisPlayer => output.Add(thisPlayer.NickName));
            return(output);
        }
Exemple #6
0
        private void CreateSets()
        {
            _rummys.HasSecond  = false;
            _rummys.HasWild    = true;
            _rummys.LowNumber  = 3;
            _rummys.HighNumber = 14;
            SetsList           = new CustomBasicList <SetList>();
            SetList firstSet = new SetList();

            firstSet.Description = "1 Set Of 3";
            AddSets(firstSet, true, 3);
            firstSet             = new SetList();
            firstSet.Description = "2 Sets Of 3";
            AddSets(firstSet, false, 3);
            firstSet             = new SetList();
            firstSet.Description = "1 Set Of 4";
            AddSets(firstSet, true, 4);
            firstSet             = new SetList();
            firstSet.Description = "2 Sets Of 4";
            AddSets(firstSet, false, 4);
            firstSet             = new SetList();
            firstSet.Description = "1 Set Of 5";
            AddSets(firstSet, true, 5);
            firstSet             = new SetList();
            firstSet.Description = "2 Sets Of 5";
            AddSets(firstSet, false, 5);
            firstSet             = new SetList();
            firstSet.Description = "1 Set Of 6";
            AddSets(firstSet, true, 6);
            firstSet             = new SetList();
            firstSet.Description = "2 Sets Of 6";
            AddSets(firstSet, false, 6);
        }
        public async Task RollMultsAsync(CustomBasicList <int> thisCol)
        {
            await _multiplier.ShowRollingAsync(thisCol);

            SaveRoot !.WhichMulti = _multiplier.Value; //i think.
            await ContinueTurnAsync();
        }
        private void GetList()
        {
            Assembly thisAssembly = Assembly.GetAssembly(GetType());
            string   thisText     = thisAssembly.ResourcesAllTextFromFile("spelling.json");

            _thisList = JsonConvert.DeserializeObject <CustomBasicList <WordInfo> >(thisText);
        }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Blades Of Steel", "Millebournes", "Opetong", "Tile Rummy"
     };
 }
Exemple #10
0
        public void PopulateNewCards(IDeckDict <PokerCardInfo> thisList)
        {
            DisplayCard thisDisplay;

            if (PokerList.Count == 0)
            {
                CustomBasicList <DisplayCard> newList = new CustomBasicList <DisplayCard>();
                if (thisList.Count != 5)
                {
                    throw new BasicBlankException("Must have 5 cards for the poker hand");
                }
                thisList.ForEach(thisCard =>
                {
                    thisDisplay             = new DisplayCard();
                    thisDisplay.CurrentCard = thisCard;
                    newList.Add(thisDisplay);
                });
                PokerList.ReplaceRange(newList);
                return;
            }
            var tempList = PokerList.Where(items => items.WillHold == false).ToCustomBasicList();

            if (tempList.Count != thisList.Count)
            {
                throw new BasicBlankException("Mismatch for populating new cards");
            }
            int x = 0;

            tempList.ForEach(temps =>
            {
                var thisCard      = thisList[x];
                temps.CurrentCard = thisCard;
                x++;
            });
        }
        private CustomBasicList <TextBlock> GetSeveralTextBoxes <P>(P thisPlayer) where P : class, IPlayerItem, new()
        {
            CustomBasicList <TextBlock> thisList = new CustomBasicList <TextBlock>();

            foreach (var firstItem in _mainGrid !.Children)
            {
                TextBlock thisText = (TextBlock)firstItem !;
                if (Grid.GetRow(thisText) > 0)
                {
                    P tempPLayer = (P)thisText.DataContext;
                    if (tempPLayer.Id == thisPlayer.Id)
                    {
                        thisList.Add(thisText);
                    }
                }
            }
            if (thisList.Count == 0)
            {
                throw new BasicBlankException($"Could not find any textboxes for player {thisPlayer.NickName}");
            }
            if (thisList.Count != _rowList !.Count)
            {
                throw new BasicBlankException($"Textboxes don't reconcile.  Found {thisList.Count} but needed {_rowList.Count}");
            }
            return(thisList);
        }
Exemple #12
0
        public void ReplaceSelectedDice()
        {
            CustomBasicList <D> TempList = DiceList.GetSelectedItems();

            DiceList.ReplaceDiceRange(TempList);
            HowManyDice = DiceList.Count;
        }
Exemple #13
0
        public CustomBasicList <CustomBasicList <D> > RollDice(int howManySections = 6)
        {
            if (DiceList.Count() != HowManyDice)
            {
                RedoList();
            }
            CustomBasicList <CustomBasicList <D> > output = new CustomBasicList <CustomBasicList <D> >();

            AsyncDelayer.SetDelayer(this, ref _delay !); //try both places.
            IGenerateDice <int>   ThisG    = MainContainer !.Resolve <IGenerateDice <int> >();
            CustomBasicList <int> possList = ThisG.GetPossibleList;

            possList.MainContainer = MainContainer;
            D   tempDice;
            int chosen;

            howManySections.Times(() =>
            {
                CustomBasicList <D> firsts = new CustomBasicList <D>();
                for (int i = 0; i < HowManyDice; i++)
                {
                    tempDice = DiceList[i];
                    if (tempDice.Hold == false) //its uncommon enough that has to be different for different types of dice games.
                    {
                        chosen         = possList.GetRandomItem();
                        tempDice       = new D();
                        tempDice.Index = i + 1;    //i think
                        tempDice.Populate(chosen); //so they can do what they need to.
                    }
                    firsts.Add(tempDice);
                }
                output.Add(firsts);
            });
            return(output);
        }
        public static CustomBasicList <CustomBasicList <int> > CheckScores(int howManyExist, int howManyNeeded)
        {
            if (howManyNeeded > howManyExist)
            {
                return(new CustomBasicList <CustomBasicList <int> >());
            }
            object[] mySet;
            CustomBasicList <CustomBasicList <int> > arr_Return = new CustomBasicList <CustomBasicList <int> >();

            mySet = new object[howManyExist - 1 + 1];
            var loopTo = howManyExist - 1;

            for (int i = 0; i <= loopTo; i++)
            {
                mySet[i] = i + 1;
            }
            // Get the unique combinations of numbers.
            CustomBasicList <CustomBasicList <object> > mySubsets = GetSubsets(mySet, howManyNeeded);

            Sort(mySubsets);
            foreach (CustomBasicList <object> i in mySubsets)
            {
                CustomBasicList <int> arr_Sample = new CustomBasicList <int>();
                foreach (int j in i)
                {
                    arr_Sample.Add(j);
                }
                arr_Return.Add(arr_Sample);
            }

            return(arr_Return);
        }
        protected override Task ConfigureAsync()
        {
            OurContainer !.RegisterNonSavedClasses <SorryCardGameShellViewModel>();
            OurContainer !.RegisterType <BasicGameLoader <SorryCardGamePlayerItem, SorryCardGameSaveInfo> >();
            OurContainer.RegisterType <RetrieveSavedPlayers <SorryCardGamePlayerItem, SorryCardGameSaveInfo> >();
            OurContainer.RegisterType <MultiplayerOpeningViewModel <SorryCardGamePlayerItem> >(true); //had to be set to true after all.
            OurContainer.RegisterType <DeckObservablePile <SorryCardGameCardInformation> >(true);
            OurContainer.RegisterType <GenericCardShuffler <SorryCardGameCardInformation> >();
            OurContainer.RegisterSingleton <IDeckCount, SorryCardGameDeckCount>();
            OurContainer.RegisterSingleton <IProportionImage, StandardProportion>("");
            //anything that needs to be registered will be here.

            OurContainer.RegisterType <BeginningColorProcessorClass <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem, SorryCardGameSaveInfo> >();
            OurContainer.RegisterType <BeginningChooseColorViewModel <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem> >(false); //did have to replace though.
            OurContainer.RegisterType <BeginningColorModel <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem> >(true);
            //all piece choices should be here.
            ViewModelViewLinker link = new ViewModelViewLinker()
            {
                ViewModelType = typeof(BeginningChooseColorViewModel <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem>),
                ViewType      = typeof(BeginningChooseColorView <PawnPiecesCP <EnumColorChoices>, PawnPiecesXF <EnumColorChoices>, EnumColorChoices>)
            };

            ViewLocator.ManuelVMList.Add(link);
            MiscDelegates.GetMiscObjectsToReplace = (() =>
            {
                CustomBasicList <Type> output = new CustomBasicList <Type>()
                {
                    typeof(BeginningColorProcessorClass <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem, SorryCardGameSaveInfo>),
                    typeof(BeginningColorModel <EnumColorChoices, PawnPiecesCP <EnumColorChoices>, SorryCardGamePlayerItem>)
                };
                return(output);
            });
            OurContainer.RegisterType <StandardPickerSizeClass>();
            return(Task.CompletedTask);
        }
 protected override async Task AfterPlayerInitAsync()
 {
     try
     {
         if (_hasIntro)
         {
             var(StartTime, HowLong) = GetSkipData();
             SkipSceneClass ThisSkip = new SkipSceneClass()
             {
                 StartTime = StartTime,
                 HowLong   = HowLong
             };
             var ThisList = new CustomBasicList <SkipSceneClass> {
                 ThisSkip
             };
             Player.AddScenesToSkip(ThisList);
         }
         var tvLength = Player.Length();
         await CalculateDurationAsync(tvLength);
     }
     catch (Exception ex)
     {
         UIPlatform.ShowError(ex.Message);
     }
 }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "8 Round Rummy", "Chinazo", "Cousin Rummy", "Dummy Rummy", "Five Crowns", "Four Suit Rummy", "Galaxy Card Game", "Monastery Card Game", "Opetong", "Phase 10", "Rummy 500", "Rummy Dice", "Tile Rummy"
     };
 }
        public XactikaVMData(IEventAggregator aggregator,
                             CommandContainer command,
                             BasicTrickAreaObservable <EnumShapes, XactikaCardInformation> trickArea1,
                             XactikaGameContainer gameContainer
                             )
        {
            Deck1          = new DeckObservablePile <XactikaCardInformation>(aggregator, command);
            Pile1          = new PileObservable <XactikaCardInformation>(aggregator, command);
            PlayerHand1    = new HandObservable <XactikaCardInformation>(command);
            TrickArea1     = trickArea1;
            _gameContainer = gameContainer;
            ModeChoose1    = new ListViewPicker(command, gameContainer.Resolver);
            ShapeChoose1   = new ChooseShapeObservable(_gameContainer);
            Bid1           = new NumberPicker(command, gameContainer.Resolver);
            ModeChoose1.ItemSelectedAsync += ModeChooser1_ItemSelectedAsync;
            Bid1.ChangedNumberValueAsync  += Bid1_ChangedNumberValueAsync;
            PlayerHand1 !.Maximum          = 8;
            ModeChoose1.IndexMethod        = EnumIndexMethod.OneBased;
            CustomBasicList <string> tempList = new CustomBasicList <string> {
                "To Win", "To Lose", "Bid"
            };

            ModeChoose1.LoadTextList(tempList);
            ShapeChoose1.SendEnableProcesses(this, (() => _gameContainer.SaveRoot.GameStatus == EnumStatusList.CallShape));
        }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Blackjack", "Bunco Dice Game", "Froggies", "Mastermind", "Minesweeper", "Poker", "Solitaire Board Game", "XPuzzle"
     };
 }
Exemple #20
0
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Accordian Solitaire", "Agnes Solitaire", "Alternation Solitaire", "Block Eleven Solitaire", "Calculation Solitaire", "Captive Queens Solitaire", "Demon Solitaire", "Little Spider Solitaire", "Raglan Solitaire"
     };
 }
        public async Task RollDiceAsync(CustomBasicList <CustomBasicList <bool> > thisList)
        {
            await DiceBoard !.ShowRollingAsync(thisList);
            int   previouss;
            int   hits;

            hits      = DiceBoard.HowManyHit();
            previouss = ScoreSheets !.PreviousHit();
            int newOnes;

            newOnes = hits - previouss;
            ScoreSheets.UpdateForSection(newOnes);
            SaveRoot !.WhichPart += 1;
            if (SaveRoot.WhichPart == 3)
            {
                if (ScoreSheets.CanExtend() == true)
                {
                    SaveRoot.IsExtended = true; // extended is for ui only.
                }
                else
                {
                    SaveRoot.IsExtended = false;
                }
            }
            else
            {
                SaveRoot.IsExtended = false;
            }
            await ContinueTurnAsync();
        }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Dutch Blitz", "Flinch", "Fluxx", "Hit The Deck", "Life Card Game", "Milk Run", "Millebournes", "Monopoly Card Game", "SkipBo", "Sorry Card Game", "Tee It Up", "Uno", "Yahtzee Hands Down"
     };
 }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "California Jack", "Galaxy Card Game", "German Whist", "Horseshoe", "Huse Hearts", "Pickel Card Game", "Pinochle (2 Player)", "Rage Card Game", "Rook", "Rounds Card Game", "Sixty Six (2 Player)", "Skuck Card Game", "Snag Card Game", "Spades (2 Player)", "Xactika"
     };
 }
Exemple #24
0
        private void Scoring(int knocks, int wins, CustomBasicList <int> scoreList)
        {
            int scores;

            for (int x = 1; x <= PlayerList.Count(); x++)
            {
                if (knocks == 0)
                {
                    scores = scoreList[x - 1];
                }
                else if (knocks > 0 && wins == knocks && knocks == x)
                {
                    scores = 0;
                }
                else if (knocks > 0 && wins != knocks && knocks == x)
                {
                    scores  = scoreList[x - 1];
                    scores *= 2;
                }
                else
                {
                    scores = scoreList[x - 1];
                }

                var thisPlayer = PlayerList ![x];
        protected override Task ConfigureAsync()
        {
            OurContainer !.RegisterType <StandardPickerSizeClass>();           //needs to keep no matter what since this is extra for xamarin forms

            OurContainer !.RegisterNonSavedClasses <ConnectTheDotsShellViewModel>();
            OurContainer !.RegisterType <BasicGameLoader <ConnectTheDotsPlayerItem, ConnectTheDotsSaveInfo> >();
            OurContainer.RegisterType <RetrieveSavedPlayers <ConnectTheDotsPlayerItem, ConnectTheDotsSaveInfo> >();
            OurContainer.RegisterType <MultiplayerOpeningViewModel <ConnectTheDotsPlayerItem> >(true);                                                        //had to be set to true after all.

            OurContainer !.RegisterSingleton <IProportionBoard, StandardProportion>("");                                                                      //here too.
            OurContainer.RegisterType <BeginningColorProcessorClass <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem, ConnectTheDotsSaveInfo> >();
            OurContainer.RegisterType <BeginningChooseColorViewModel <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem> >(false); //did have to replace though.
            OurContainer.RegisterType <BeginningColorModel <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem> >(true);
            //all piece choices should be here.
            ViewModelViewLinker link = new ViewModelViewLinker()
            {
                ViewModelType = typeof(BeginningChooseColorViewModel <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem>),
                ViewType      = typeof(BeginningChooseColorView <CheckerChoiceCP <EnumColorChoice>, CheckerChooserXF <EnumColorChoice>, EnumColorChoice>)
            };

            ViewLocator.ManuelVMList.Add(link);
            MiscDelegates.GetMiscObjectsToReplace = (() =>
            {
                CustomBasicList <Type> output = new CustomBasicList <Type>()
                {
                    typeof(BeginningColorProcessorClass <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem, ConnectTheDotsSaveInfo>),
                    typeof(BeginningColorModel <EnumColorChoice, CheckerChoiceCP <EnumColorChoice>, ConnectTheDotsPlayerItem>)
                };
                return(output);
            });
            //anything that needs to be registered will be here.
            return(Task.CompletedTask);
        }
 public void RenderSvgTree(CustomBasicList <object> objects, int k, RenderTreeBuilder builder)
 {
     objects.ForEach(obj =>
     {
         RenderSvgTree(obj, k, builder);
     });
 }
        public CustomBasicList <CheckersChessVector> GetValidMoves()
        {
            CustomBasicList <CheckersChessVector> possibleList = new CustomBasicList <CheckersChessVector>
            {
                new CheckersChessVector(Row + 1, Column + 1),
                new CheckersChessVector(Row - 1, Column - 1),
                new CheckersChessVector(Row + 1, Column),
                new CheckersChessVector(Row - 1, Column),
                new CheckersChessVector(Row, Column + 1),
                new CheckersChessVector(Row, Column - 1),
                new CheckersChessVector(Row - 1, Column + 1),
                new CheckersChessVector(Row + 1, Column - 1)
            };
            CustomBasicList <CheckersChessVector> finalList = new CustomBasicList <CheckersChessVector>();
            SpaceCP?c;

            foreach (var thisPos in possibleList)
            {
                c = GameBoardGraphicsCP.GetSpace(thisPos.Row, thisPos.Column);
                if (c != null)
                {
                    if (c.PlayerOwns != Player)
                    {
                        // can't be yourself period.
                        finalList.Add(thisPos);
                    }
                }
            }
            return(finalList);
        }
Exemple #28
0
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "MahJong Solitaire", "Klondike Solitaire", "Bisley Solitaire", "Florentine Solitaire", "Free Cell Solitaire", "Bakers Dozen Solitaire", "Beleagured Castle", "Eight Off Solitaire", "Spider Solitaire", "Martha Solitaire", "Persian Solitaire", "Grandfather's Clock", "Pyramid Solitaire"
     };
 }
 protected override void GenerateGameList()
 {
     GameList = new CustomBasicList <string>()
     {
         "Aggravation", "Backgammon", "Candyland", "Clue Board Game", "Life Board Game", "Payday", "Sorry", "Trouble"
     };
 }
Exemple #30
0
 public CustomBasicList <C> GetWinCombo(CustomBasicList <CustomBasicList <C> > comboList)
 {
     foreach (var currentCombo in comboList)
     {
         if (currentCombo.All(temps => temps.IsFilled()) == true)
         {
             object searchObject = MainObjectSelector !.Invoke(currentCombo.First());
             bool   allTrue      = true;
             object compareObject;
             foreach (var item in currentCombo)
             {
                 compareObject = MainObjectSelector.Invoke(item);
                 if (compareObject.Equals(searchObject) == false) //try this way.
                 {
                     allTrue = false;
                     break;
                 }
             }
             if (allTrue == true)
             {
                 return(currentCombo);
             }
         }
     }
     ;
     return(new CustomBasicList <C>());
 }