public void Init(BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> > main)
        {
            WastePiles thisWaste = Resolve <WastePiles>();

            if (thisWaste.Discards !.PileList !.Count != 8)
            {
                throw new BasicBlankException("There must be 8 piles total");
            }
            _thisGrid = new Grid();
            Margin    = new Thickness(10, 5, 5, 5);
            AddAutoColumns(_thisGrid, 4);
            AddAutoRows(_thisGrid, 3);
            var thisList = thisWaste.Discards.PileList.Take(4).ToCustomBasicList();

            main.Margin = new Thickness(0, 0, 0, 0);
            CustomMain thisMain = Resolve <CustomMain>();

            main.Init(thisMain.Piles, ts.TagUsed);
            LoadList(0, thisList, thisWaste);
            AddControlToGrid(_thisGrid, main, 1, 0);
            Grid.SetColumnSpan(main, 4);
            thisList = thisWaste.Discards.PileList.Skip(4).ToCustomBasicList();
            LoadList(2, thisList, thisWaste);
            Content = _thisGrid;
        }
Ejemplo n.º 2
0
        private void SetUpTeamPiles()
        {
            _mainGame !.SingleInfo = _mainGame.PlayerList !.GetSelf();
            if (_mainGame.SingleInfo.MainHandList.Any(items => items.CompleteCategory == EnumCompleteCategories.None))
            {
                throw new BasicBlankException("Cannot have category of none.  Rethink");
            }
            _pileGrid !.Children.Clear();
            int x = 0;

            _gameContainer.TeamList.ForEach(thisTeam =>
            {
                x++;
                Grid tempGrid   = new Grid();
                tempGrid.Margin = new Thickness(0, 0, 0, 5);
                Label ThisLabel = new Label();
                if (ScreenUsed == EnumScreen.SmallPhone)
                {
                    ThisLabel.FontSize = 8;
                    AddPixelRow(tempGrid, 12);
                    AddPixelRow(tempGrid, 68);
                }
                else
                {
                    AddAutoRows(tempGrid, 1);
                    AddLeftOverRow(tempGrid, 1);
                    if (ScreenUsed == EnumScreen.SmallTablet)
                    {
                        ThisLabel.FontSize = 12;
                    }
                    else
                    {
                        ThisLabel.FontSize = 20;
                    }
                }
                AddAutoColumns(tempGrid, 2);
                ThisLabel.Text           = thisTeam.Text;
                ThisLabel.TextColor      = Color.Aqua;
                ThisLabel.FontAttributes = FontAttributes.Bold;
                AddControlToGrid(tempGrid, ThisLabel, 0, 0);
                ThisLabel.HorizontalOptions = LayoutOptions.Center; // try this
                BasicMultiplePilesXF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsXF> thisDis = new BasicMultiplePilesXF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsXF>();
                thisDis.Init(thisTeam.CardPiles, "");
                thisDis.StartAnimationListener("team" + thisTeam.TeamNumber);
                AddControlToGrid(tempGrid, thisDis, 1, 0);
                SafetiesXF thisS = new SafetiesXF();
                thisS.Init(thisTeam, _mainGame, _gameContainer.Command);
                _disList.Add(thisDis);
                if (x == 1)
                {
                    AddControlToGrid(tempGrid, thisS, 0, 1);
                    Grid.SetRowSpan(thisS, 2);
                }
                else
                {
                    AddControlToGrid(tempGrid, thisS, 1, 1);
                }
                AddControlToGrid(_pileGrid, tempGrid, x - 1, 0);
            });
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            HeapSolitaireMainViewModel model = (HeapSolitaireMainViewModel)BindingContext;

            _mainPile.Init(model.Main1, ts.TagUsed);
            _wastePile.Init(model);

            return(Task.CompletedTask);
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            EagleWingsSolitaireMainViewModel model = (EagleWingsSolitaireMainViewModel)BindingContext;

            _waste.Init(model);
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);
            return(Task.CompletedTask);
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            GamePackageViewModelBinder.ManuelElements.Clear();                     //often times i have to add manually.

            ConcentrationSaveInfo save = cons !.Resolve <ConcentrationSaveInfo>(); //usually needs this part for multiplayer games.

            _score !.LoadLists(save.PlayerList);
            _board.Init(_model.GameBoard1, ts.TagUsed);
            return(this.RefreshBindingsAsync(_aggregator));
        }
Ejemplo n.º 6
0
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            PersianSolitaireMainViewModel model = (PersianSolitaireMainViewModel)BindingContext;
            var tempWaste = (WastePiles)model.WastePiles1 !;

            _waste.Init(tempWaste.Piles);
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);
            return(Task.CompletedTask);
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            BeleaguredCastleMainViewModel model = (BeleaguredCastleMainViewModel)BindingContext;
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);
            var tempWaste = (WastePiles)model.WastePiles1 !;

            _waste.Init(tempWaste.Piles, _main);
            return(this.RefreshBindingsAsync(_aggregator));
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            EasyGoSolitaireMainViewModel model = (EasyGoSolitaireMainViewModel)BindingContext;
            var tempWaste = (WastePiles)model.WastePiles1 !;

            _waste.Init(tempWaste.Discards !, ts.TagUsed);
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);
            return(this.RefreshBindingsAsync(_aggregator));
        }
Ejemplo n.º 9
0
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            //todo:  most of the time needs this.  if in a case its not needed, then delete then.
            EightOffSolitaireMainViewModel model = (EightOffSolitaireMainViewModel)BindingContext;
            var tempWaste = (WastePiles)model.WastePiles1 !;

            _waste.Init(tempWaste.Piles);
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);
            _reserve.LoadList(model.ReservePiles1, ts.TagUsed);
            return(Task.CompletedTask);
        }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            AlternationSolitaireSaveInfo thisSave = cons !.Resolve <AlternationSolitaireSaveInfo>();
            //todo:  most of the time needs this.  if in a case its not needed, then delete then.
            AlternationSolitaireMainViewModel model = (AlternationSolitaireMainViewModel)BindingContext;
            var tempWaste = (WastePiles)model.WastePiles1 !;

            _waste.Init(tempWaste.Piles);
            var tempMain = (MainPilesCP)model.MainPiles1 !;

            _main.Init(tempMain.Piles, ts.TagUsed);

            return(this.RefreshBindingsAsync(_aggregator));
        }