Exemplo n.º 1
0
        public RageCardGameMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    RageCardGameVMData model
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF>();
            _trick1        = new SeveralPlayersTrickXF <EnumColor, RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF, RageCardGamePlayerItem>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(RageCardGameMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            PopulateScores(_score);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(RageCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(RageCardGameMainViewModel.Status));
            firstInfo.AddRow("Trump", nameof(RageCardGameMainViewModel.TrumpSuit));
            firstInfo.AddRow("Lead", nameof(RageCardGameMainViewModel.Lead));
            mainStack.Children.Add(_trick1);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_score);

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }

            GamePackageViewModelBinder.ManuelElements.Clear();                   //often times i have to add manually.

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

            _score !.LoadLists(save.PlayerList);
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, "");        // i think

            _trick1 !.Init(_model.TrickArea1 !, _model.TrickArea1, ""); //just in case the load won't work properly this time on xamarin forms.

            Content = mainStack;
        }
        public MailPileView(PaydayVMData data)
        {
            BasePileXF <MailCard, CardGraphicsCP, MailCardXF> pile = new BasePileXF <MailCard, CardGraphicsCP, MailCardXF>();

            pile.Init(data.MailPile, "");
            Content = pile;
        }
Exemplo n.º 3
0
        public TriangleSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile    = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _triangle     = new TriangleXF();
            StackLayout stack = new StackLayout();

            stack.Children.Add(_deckGPile);

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;

            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;
            StackLayout other = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            other.Children.Add(_deckGPile);
            other.Children.Add(_discardGPile);
            other.Children.Add(_triangle);
            stack.Children.Add(other);


            Content = stack; //if not doing this, rethink.
        }
        public SpadesBeginningView(Spades2PlayerVMData model, IEventAggregator aggregator)
        {
            StackLayout stack = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            _deckGPile    = new BaseDeckXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _discardGPile = new BasePileXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _other        = new BasePileXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            stack.Children.Add(_deckGPile);
            stack.Children.Add(_discardGPile);
            var button = GetGamingButton("Take Card", nameof(SpadesBeginningViewModel.TakeCardAsync));

            stack.Children.Add(button);
            stack.Children.Add(_other);
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            _other.Margin        = new Thickness(5);

            Content     = stack;
            _model      = model;
            _aggregator = aggregator;
        }
Exemplo n.º 5
0
        public FaceoffView(BladesOfSteelVMData model, IEventAggregator aggregator)
        {
            aggregator.Subscribe(this);
            _yourFace     = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _opponentFace = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();

            StackLayout stack = new StackLayout();

            _deck                   = new BaseDeckXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _model                  = model;
            _aggregator             = aggregator;
            _deck.HorizontalOptions = LayoutOptions.Start;
            _deck.VerticalOptions   = LayoutOptions.Start;
            stack.Children.Add(_deck);
            SimpleLabelGridXF firsts = new SimpleLabelGridXF();

            firsts.AddRow("Instructions", nameof(FaceoffViewModel.Instructions));
            stack.Children.Add(firsts.GetContent);

            StackLayout other = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            stack.Children.Add(other);
            other.Children.Add(_yourFace);
            other.Children.Add(_opponentFace);
            _yourFace.HorizontalOptions     = LayoutOptions.Start;
            _yourFace.VerticalOptions       = LayoutOptions.Start;
            _opponentFace.HorizontalOptions = LayoutOptions.Start;
            _yourFace.VerticalOptions       = LayoutOptions.Start;
            _yourFace.Margin     = new Thickness(5);
            _opponentFace.Margin = new Thickness(5);
            Content = stack;
        }
Exemplo n.º 6
0
        public GoFishMainView(IEventAggregator aggregator,
                              TestOptions test,
                              GoFishVMData model
                              )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _discardGPile = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _score        = new ScoreBoardXF();
            _playerHandXF = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(GoFishMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            var endButton = GetGamingButton("End Turn", nameof(GoFishMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            endButton.VerticalOptions   = LayoutOptions.Start;
            _score.AddColumn("Cards Left", true, nameof(GoFishPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Pairs", true, nameof(GoFishPlayerItem.Pairs));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(GoFishMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(GoFishMainViewModel.Status));
            StackLayout finalStack = new StackLayout();

            otherStack.Children.Add(finalStack);
            finalStack.Children.Add(endButton);
            finalStack.Children.Add(firstInfo.GetContent);
            finalStack.Children.Add(_score);
            mainStack.Children.Add(_playerHandXF);
            ParentSingleUIContainer ask = new ParentSingleUIContainer(nameof(GoFishMainViewModel.AskScreen));

            mainStack.Children.Add(ask);

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 7
0
        public CribbagePatienceMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <CribbageCard, ts, DeckOfCardsXF <CribbageCard> >();
            StackLayout stack = new StackLayout();

            stack.Children.Add(_deckGPile);

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;

            _hand1Score = new ScoreHandCribUI();
            _hand2Score = new ScoreHandCribUI();
            _cribScore  = new ScoreHandCribUI();
            _score1     = new ScoreSummaryUI();
            _yourHand   = new BaseHandXF <CribbageCard, ts, DeckOfCardsXF <CribbageCard> >();
            _cribHand   = new BaseHandXF <CribbageCard, ts, DeckOfCardsXF <CribbageCard> >();
            SetMargins(_score1);
            SetMargins(_hand1Score);
            SetMargins(_hand2Score);
            SetMargins(_cribScore);
            SetMargins(_cribHand);
            SetMargins(_yourHand); //i think should be this too.
            Grid grid = new Grid();

            AddLeftOverRow(grid, 40);
            AddLeftOverRow(grid, 60);
            AddAutoRows(grid, 1);
            AddAutoColumns(grid, 1);
            AddLeftOverColumn(grid, 40);
            AddLeftOverColumn(grid, 40);
            AddControlToGrid(grid, stack, 2, 0);
            Grid.SetColumnSpan(stack, 3);
            stack.Orientation = StackOrientation.Horizontal;
            var cributton      = GetGamingButton("To Crib", nameof(CribbagePatienceMainViewModel.CribAsync));
            var continueButton = GetGamingButton("Continue", nameof(CribbagePatienceMainViewModel.Continue)); //to experiment

            stack.Children.Add(cributton);
            stack.Children.Add(continueButton);
            StackLayout otherStack = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            stack = new StackLayout();
            otherStack.Children.Add(_deckGPile);
            _startCard = new BasePileXF <CribbageCard, ts, DeckOfCardsXF <CribbageCard> >();
            otherStack.Children.Add(_startCard);
            stack.Children.Add(otherStack);
            stack.Children.Add(_yourHand);
            AddControlToGrid(grid, stack, 1, 0);
            AddControlToGrid(grid, _cribHand, 0, 0);
            AddControlToGrid(grid, _score1, 0, 2);
            _grid = grid;

            Content = grid;
        }
        public AlternationSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);


            _main        = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _main.Margin = new Thickness(100, 5, 5, 5);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(AlternationSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(AlternationSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesXF();
            //not sure where to place
            //needs to init.  however, needs a waste viewmodel to hook to.  the interface does not require to necessarily use it.
            //sometimes its more discard piles.

            StackLayout tempStack = new StackLayout();

            otherStack.Children.Add(tempStack);
            tempStack.Children.Add(tempGrid);
            tempStack.Children.Add(autoBut);

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;

            stack.Children.Add(otherStack);
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);

            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);


            Content = stack; //if not doing this, rethink.
        }
Exemplo n.º 9
0
        public TeeItUpMainView(IEventAggregator aggregator,
                               TestOptions test,
                               TeeItUpVMData model,
                               TeeItUpGameContainer gameContainer
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer          = gameContainer;
            _deckGPile              = new BaseDeckXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            _discardGPile           = new BasePileXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            _score                  = new ScoreBoardXF();
            _boardStack             = new StackLayout();
            _boardStack.Orientation = StackOrientation.Horizontal;
            _otherPile              = new BasePileXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TeeItUpMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            otherStack.Children.Add(_otherPile);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Went Out", true, nameof(TeeItUpPlayerItem.WentOut), useTrueFalse: true);
            _score.AddColumn("Previous Score", true, nameof(TeeItUpPlayerItem.PreviousScore));
            _score.AddColumn("Total Score", true, nameof(TeeItUpPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(TeeItUpMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(TeeItUpMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(TeeItUpMainViewModel.Round));
            firstInfo.AddRow("Instructions", nameof(TeeItUpMainViewModel.Instructions));

            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_boardStack);


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public RoundsCardGameMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      RoundsCardGameVMData model
                                      )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <RoundsCardGameCardInformation, ts, DeckOfCardsXF <RoundsCardGameCardInformation> >();
            _discardGPile  = new BasePileXF <RoundsCardGameCardInformation, ts, DeckOfCardsXF <RoundsCardGameCardInformation> >();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <RoundsCardGameCardInformation, ts, DeckOfCardsXF <RoundsCardGameCardInformation> >();
            _trick1        = new TwoPlayerTrickXF <EnumSuitList, RoundsCardGameCardInformation, ts, DeckOfCardsXF <RoundsCardGameCardInformation> >();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(RoundsCardGameMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("# In Hand", true, nameof(RoundsCardGamePlayerItem.ObjectCount));
            _score.AddColumn("Tricks Won", true, nameof(RoundsCardGamePlayerItem.TricksWon));
            _score.AddColumn("Rounds Won", true, nameof(RoundsCardGamePlayerItem.RoundsWon));
            _score.AddColumn("Points", true, nameof(RoundsCardGamePlayerItem.CurrentPoints));
            _score.AddColumn("Total Score", true, nameof(RoundsCardGamePlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(RoundsCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Trump", nameof(RoundsCardGameMainViewModel.TrumpSuit));
            firstInfo.AddRow("Status", nameof(RoundsCardGameMainViewModel.Status));
            mainStack.Children.Add(_trick1);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            mainStack.Children.Add(_score);
            //this is only a starting point.

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public CrazyEightsMainView(IEventAggregator aggregator,
                                   TestOptions test,
                                   CrazyEightsVMData model
                                   )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _discardGPile  = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(CrazyEightsMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);                                           // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", false, nameof(CrazyEightsPlayerItem.ObjectCount)); //very common.
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(CrazyEightsMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(CrazyEightsMainViewModel.Status));

            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_score);

            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(CrazyEightsMainViewModel.SuitScreen));

            mainStack.Children.Add(parent);
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 12
0
        public OldMaidMainView(IEventAggregator aggregator,
                               TestOptions test,
                               OldMaidVMData model
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _discardGPile          = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _playerHandWPF         = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _playerHandWPF.Divider = 2;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(OldMaidMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(OldMaidMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(OldMaidMainViewModel.Status));

            var endButton = GetGamingButton("End Turn", nameof(OldMaidMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            otherStack.Children.Add(endButton);

            ParentSingleUIContainer opponent = new ParentSingleUIContainer(nameof(OldMaidMainViewModel.OpponentScreen));

            mainStack.Children.Add(opponent);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(firstInfo.GetContent);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP);                        //default add to grid but does not have to.
            }
            GamePackageViewModelBinder.ManuelElements.Clear();           //often times i have to add manually.
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think
            _discardGPile !.Init(_model.Pile1 !, ts.TagUsed);            // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile();                   // its the main one.
            Content = mainStack;
        }
        public VegasSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _main        = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut     = GetSmallerButton("Auto Make Move", nameof(VegasSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();
            var thisCon     = new CurrencyConverter();

            scoresAlone.AddRow("Money", nameof(VegasSolitaireMainViewModel.Money), thisCon);
            var tempGrid = scoresAlone.GetContent;

            _waste               = new SolitairePilesXF();
            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            otherStack.Children.Add(_main);
            stack.Children.Add(otherStack);
            stack.Children.Add(_waste);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            AddControlToGrid(grid, stack, 0, 0);

            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            stack        = new StackLayout();
            stack.Margin = new Thickness(20, 5, 5, 5);
            AddControlToGrid(grid, stack, 0, 1);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);

            Content = grid; //if not doing this, rethink.
        }
        public DemonSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack = new StackLayout();

            _main        = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(DemonSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(DemonSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Starting Number", nameof(DemonSolitaireMainViewModel.StartingNumber));
            var tempGrid = scoresAlone.GetContent;

            tempGrid.WidthRequest = 150;
            _waste                  = new SolitairePilesXF();
            _deckGPile.Margin       = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin    = new Thickness(5, 5, 5, 5);
            _heel.HorizontalOptions = LayoutOptions.Start;
            _heel.VerticalOptions   = LayoutOptions.Start;
            Grid grid = new Grid();

            AddAutoColumns(grid, 3);
            AddAutoRows(grid, 2);
            AddControlToGrid(grid, _deckGPile, 0, 0);
            AddControlToGrid(grid, _discardGPile, 0, 1);
            AddControlToGrid(grid, _main, 0, 2);
            AddControlToGrid(grid, _heel, 1, 1);
            AddControlToGrid(grid, _waste, 1, 2);
            stack.Children.Add(tempGrid);
            AddControlToGrid(grid, stack, 1, 0);
            _heel.Margin  = new Thickness(0, 5, 0, 0);
            _waste.Margin = new Thickness(0, 25, 0, 0);
            stack.Margin  = new Thickness(0, 5, 5, 0);
            Content       = grid;
        }
        public CarpetSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            _main        = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(CarpetSolitaireMainViewModel.AutoMoveAsync));

            autoBut.HorizontalOptions = LayoutOptions.Start;
            autoBut.VerticalOptions   = LayoutOptions.Start;
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(CarpetSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            tempGrid.WidthRequest = 50; //sometimes i am forced to do this
            _deckGPile.Margin     = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin  = new Thickness(5, 5, 5, 5);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            AddControlToGrid(grid, stack, 0, 0);
            stack = new StackLayout();
            stack.Children.Add(_main);
            stack.Children.Add(_discard);
            AddControlToGrid(grid, stack, 0, 1);
            Content = grid;
        }
        public EagleWingsSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            _main        = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _main.Margin = new Thickness(0, 5, 5, 5);
            stack.Children.Add(otherStack);
            var autoBut     = GetSmallerButton("Auto Make Move", nameof(EagleWingsSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(EagleWingsSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Starting Number", nameof(EagleWingsSolitaireMainViewModel.StartingNumber));
            var tempGrid = scoresAlone.GetContent;

            _waste = new PlaneUI();
            //_waste.Margin = new Thickness(30, 30, 0, 0);
            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            StackLayout tempStack = new StackLayout();

            tempStack.Orientation = StackOrientation.Horizontal;
            stack.Children.Add(otherStack);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            tempStack.Children.Add(stack);
            stack = new StackLayout();
            stack.Children.Add(_main);
            stack.Children.Add(_waste);
            tempStack.Children.Add(stack);
            Content = tempStack;
        }
Exemplo n.º 17
0
        public PyramidSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile                      = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack = new StackLayout();

            _currentCard = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _playerBoard = new CardBoardXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _triangle    = new TriangleXF();
            var playButton = GetGamingButton("Play Selected Cards", nameof(PyramidSolitaireMainViewModel.PlaySelectedCardsAsync));

            stack.Children.Add(_deckGPile);

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;


            StackLayout other = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            other.Children.Add(_deckGPile);
            other.Children.Add(_discardGPile);
            other.Children.Add(_currentCard);
            other.Children.Add(_triangle);
            stack.Children.Add(other);
            stack.Children.Add(_playerBoard);

            playButton.HorizontalOptions = LayoutOptions.Start;
            playButton.VerticalOptions   = LayoutOptions.Start;
            stack.Children.Add(playButton);
            var thisLabel = new SimpleLabelGridXF();

            thisLabel.AddRow("Score", nameof(PyramidSolitaireMainViewModel.Score));
            stack.Children.Add(thisLabel.GetContent);

            Content = stack; //if not doing this, rethink.
        }
        private readonly MainUI _main; //if something change here.
        public CaptiveQueensSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            _deckGPile.Margin            = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalOptions = LayoutOptions.Start;
            _deckGPile.VerticalOptions   = LayoutOptions.Start;
            _discardGPile                   = new BasePileXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();
            _discardGPile.Margin            = new Thickness(5);
            _discardGPile.HorizontalOptions = LayoutOptions.Start;
            _discardGPile.VerticalOptions   = LayoutOptions.Start;

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            stack.Children.Add(otherStack);
            _main        = new MainUI();
            _main.Margin = new Thickness(10, 5, 5, 5);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(CaptiveQueensSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(CaptiveQueensSolitaireMainViewModel.Score));
            scoresAlone.AddRow("First Start Number", nameof(CaptiveQueensSolitaireMainViewModel.FirstNumber));
            scoresAlone.AddRow("Second Start Number", nameof(CaptiveQueensSolitaireMainViewModel.SecondNumber));
            var tempGrid = scoresAlone.GetContent;

            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            stack.Children.Add(tempGrid);

            StackLayout finalStack = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            Content = finalStack;
            finalStack.Children.Add(stack);
            finalStack.Children.Add(_main);
        }
        public FiveCrownsMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  FiveCrownsVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsXF>();
            _tempG         = new TempRummySetsXF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsXF>();
            _mainG         = new MainRummySetsXF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsXF, PhaseSet, SavedSet>();

            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(FiveCrownsMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);                                         // can reposition or not even have as well.
            _score.AddColumn("Cards Left", true, nameof(FiveCrownsPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Current Score", true, nameof(FiveCrownsPlayerItem.CurrentScore));
            _score.AddColumn("Total Score", true, nameof(FiveCrownsPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(FiveCrownsMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(FiveCrownsMainViewModel.Status));
            firstInfo.AddRow("Up To", nameof(FiveCrownsMainViewModel.UpTo));


            Grid finalGrid = new Grid();

            AddAutoRows(finalGrid, 1);
            AddLeftOverRow(finalGrid, 1);
            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 40);
            AddAutoColumns(firstGrid, 1);
            AddLeftOverColumn(firstGrid, 15);
            AddLeftOverColumn(firstGrid, 30);

            var thisBut = GetSmallerButton("Lay Down", nameof(FiveCrownsMainViewModel.LayDownSetsAsync));


            AddControlToGrid(firstGrid, otherStack, 0, 1);
            StackLayout firstStack = new StackLayout();

            firstStack.Children.Add(_playerHandWPF);
            StackLayout secondStack = new StackLayout();

            secondStack.Orientation = StackOrientation.Horizontal;
            firstStack.Children.Add(secondStack);
            firstStack.Children.Add(thisBut);
            thisBut = GetSmallerButton("Back", nameof(FiveCrownsMainViewModel.Back));
            firstStack.Children.Add(thisBut);

            AddControlToGrid(firstGrid, firstStack, 0, 0);
            AddControlToGrid(firstGrid, _score, 0, 3);
            AddControlToGrid(finalGrid, firstGrid, 0, 0);
            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 2);
            _tempG.Divider = 1.1;
            StackLayout thirdStack = new StackLayout();

            thirdStack.Orientation = StackOrientation.Horizontal;
            thirdStack.Children.Add(_tempG);
            thirdStack.Children.Add(_mainG);
            AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                otherStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = finalGrid;
        }
        public ClueBoardGameMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     ClueBoardGameVMData model,
                                     GameBoardGraphicsCP graphicsCP,
                                     IGamePackageRegister register,
                                     ClueBoardGameMainGameClass mainGame,
                                     ClueBoardGameGameContainer gameContainer
                                     )
        {
            _mainGame      = mainGame;
            _gameContainer = gameContainer;
            _aggregator    = aggregator;
            _model         = model;
            _aggregator.Subscribe(this);
            register.RegisterControl(_board.ThisElement, "");
            graphicsCP.LinkBoard();
            _piece = new PawnPiecesXF <EnumColorChoice>();
            _piece.HeightRequest = 80;
            _piece.WidthRequest  = 80;
            _piece.Init();
            _pile       = new BasePileXF <CardInfo, CardCP, CardXF>();
            _hand       = new BaseHandXF <CardInfo, CardCP, CardXF>();
            _detective  = new DetectiveNotebookXF();
            _prediction = new PredictionAccusationXF();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(ClueBoardGameMainViewModel.RestoreScreen));
            }
            _predictionButton = GetSmallerButton("Predict", nameof(ClueBoardGameMainViewModel.MakePredictionAsync));
            _accusationButton = GetSmallerButton("Accusation", nameof(ClueBoardGameMainViewModel.MakeAccusationAsync));

            StackLayout firstStack = new StackLayout();

            firstStack.Orientation = StackOrientation.Horizontal;
            firstStack.Children.Add(_board);

            firstStack.Children.Add(_piece);
            mainStack.Children.Add(firstStack);
            Grid tempGrid = new Grid();

            AddLeftOverColumn(tempGrid, 50);
            AddLeftOverColumn(tempGrid, 50);
            AddAutoColumns(tempGrid, 1);
            mainStack.Children.Add(tempGrid);
            AddControlToGrid(tempGrid, _prediction, 0, 0);
            _board.HorizontalOptions = LayoutOptions.Start;
            _board.VerticalOptions   = LayoutOptions.Start;
            Label label = new Label();

            label.FontSize       = 30;
            label.TextColor      = Color.White;
            label.FontAttributes = FontAttributes.Bold;
            label.SetBinding(Label.TextProperty, new Binding(nameof(ClueBoardGameMainViewModel.LeftToMove)));
            StackLayout tempStack = new StackLayout();

            var thisRoll = GetSmallerButton("Roll Dice", nameof(ClueBoardGameMainViewModel.RollDiceAsync));

            _diceControl = new DiceListControlXF <SimpleDice>();
            var endButton = GetSmallerButton("End Turn", nameof(ClueBoardGameMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            tempStack.Children.Add(label);
            tempStack.Children.Add(thisRoll);
            tempStack.Children.Add(endButton);
            tempStack.Children.Add(_pile);
            tempStack.Children.Add(_diceControl);
            AddControlToGrid(tempGrid, _detective, 0, 1);
            AddControlToGrid(tempGrid, tempStack, 0, 2);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(ClueBoardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Instructions", nameof(ClueBoardGameMainViewModel.Instructions));
            _details = firstInfo.GetContent;
            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 21
0
        public GolfCardGameMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    GolfCardGameVMData model,
                                    GolfCardGameGameContainer gameContainer
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _deckGPile    = new BaseDeckXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _discardGPile = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _score        = new ScoreBoardXF();

            _hiddenWPF    = new BasicMultiplePilesXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _otherPileWPF = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _golfWPF      = new CardBoardXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            ParentSingleUIContainer?restoreP  = null;
            StackLayout             mainStack = new StackLayout();

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(GolfCardGameMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            var button = GetGamingButton("Knock", nameof(GolfCardGameMainViewModel.KnockAsync));

            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);
            _score.UseAbbreviationForTrueFalse = true;
            mainStack.Children.Add(_hiddenWPF);
            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_golfWPF);
            otherStack.Children.Add(_otherPileWPF);
            mainStack.Children.Add(otherStack);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(GolfCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(GolfCardGameMainViewModel.Status));
            Grid finalGrid = new Grid();

            AddLeftOverColumn(finalGrid, 40);
            AddLeftOverColumn(finalGrid, 60);                                                               // this is for scoreboard
            _score.AddColumn("Knocked", false, nameof(GolfCardGamePlayerItem.Knocked), useTrueFalse: true); // well see how this work.  hopefully this simple.
            _score.AddColumn("1 Changed", false, nameof(GolfCardGamePlayerItem.FirstChanged), useTrueFalse: true);
            _score.AddColumn("2 Changed", false, nameof(GolfCardGamePlayerItem.SecondChanged), useTrueFalse: true);
            _score.AddColumn("Previous Score", false, nameof(GolfCardGamePlayerItem.PreviousScore), rightMargin: 20);
            _score.AddColumn("Total Score", false, nameof(GolfCardGamePlayerItem.TotalScore), rightMargin: 20);
            firstInfo.AddRow("Round", nameof(GolfCardGameMainViewModel.Round));
            firstInfo.AddRow("Instructions", nameof(GolfCardGameMainViewModel.Instructions));
            mainStack.Children.Add(finalGrid);
            AddControlToGrid(finalGrid, firstInfo.GetContent, 0, 0);
            AddControlToGrid(finalGrid, _score, 0, 1);

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            _score !.LoadLists(gameContainer.SaveRoot.PlayerList);


            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }



            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 22
0
        public LifeCardGameMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    LifeCardGameVMData model,
                                    LifeCardGameGameContainer gameContainer
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer = gameContainer;
            _deckGPile     = new BaseDeckXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>();
            _currentCard   = new BasePileXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(LifeCardGameMainViewModel.RestoreScreen));
            }
            _storyStack.Orientation = StackOrientation.Horizontal;
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            otherStack.Children.Add(_currentCard);
            mainStack.Children.Add(otherStack);

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            Button button;

            button = GetGamingButton("Years Passed", nameof(LifeCardGameMainViewModel.YearsPassedAsync));
            otherStack.Children.Add(button);
            button = GetGamingButton("Play Card", nameof(LifeCardGameMainViewModel.PlayCardAsync));
            otherStack.Children.Add(button);
            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(LifeCardGameMainViewModel.OtherScreen))
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start
            };

            otherStack.Children.Add(parent);



            _score.AddColumn("Cards Left", true, nameof(LifeCardGamePlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Points", true, nameof(LifeCardGamePlayerItem.Points));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(LifeCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(LifeCardGameMainViewModel.Status));
            mainStack.Children.Add(_playerHandWPF);
            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(otherStack);
            StackLayout finalStack = new StackLayout();

            finalStack.Orientation = StackOrientation.Horizontal;
            finalStack.Children.Add(mainStack);
            finalStack.Children.Add(_storyStack);


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = finalStack;
        }
Exemplo n.º 23
0
        public MilkRunMainView(IEventAggregator aggregator,
                               TestOptions test,
                               MilkRunVMData model,
                               MilkRunGameContainer gameContainer
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer = gameContainer;
            _deckGPile     = new BaseDeckXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _playerHandWPF = new BaseHandXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();

            _opponentChocolateDeliveries  = new Label();
            _opponentChocolatePiles       = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _opponentStrawberryDeliveries = new Label();
            _opponentStrawberryPiles      = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _yourChocolateDeliveries      = new Label();
            _yourChocolatePiles           = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _yourStrawberryDeliveries     = new Label();
            _yourStrawberryPiles          = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();


            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(MilkRunMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            AddPlayArea(otherStack);
            mainStack.Children.Add(otherStack);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(MilkRunMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(MilkRunMainViewModel.Status));


            StackLayout newStack = new StackLayout();

            mainStack.Children.Add(newStack);
            newStack.HorizontalOptions = LayoutOptions.Center;
            newStack.Margin            = new Thickness(0, 10, 0, 0);
            newStack.Children.Add(_playerHandWPF);
            newStack.Children.Add(firstInfo.GetContent);



            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public Phase10MainView(IEventAggregator aggregator,
                               TestOptions test,
                               Phase10VMData model
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <Phase10CardInformation, Phase10GraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <Phase10CardInformation, Phase10GraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <Phase10CardInformation, Phase10GraphicsCP, CardGraphicsXF>();
            _tempG         = new TempRummySetsXF <EnumColorTypes, EnumColorTypes, Phase10CardInformation, Phase10GraphicsCP, CardGraphicsXF>();
            _mainG         = new MainRummySetsXF <EnumColorTypes, EnumColorTypes, Phase10CardInformation, Phase10GraphicsCP, CardGraphicsXF, PhaseSet, SavedSet>();

            Grid finalGrid = new Grid();

            AddAutoRows(finalGrid, 1); // has to be this way because of scoreboard.
            AddLeftOverRow(finalGrid, 1);


            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(Phase10MainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            _score.AddColumn("Score", true, nameof(Phase10PlayerItem.TotalScore));
            _score.AddColumn("Cards Left", true, nameof(Phase10PlayerItem.ObjectCount));
            _score.AddColumn("Phase", true, nameof(Phase10PlayerItem.Phase));
            _score.AddColumn("Skipped", true, nameof(Phase10PlayerItem.MissNextTurn), useTrueFalse: true);
            _score.AddColumn("Completed", true, nameof(Phase10PlayerItem.Completed), useTrueFalse: true);

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(Phase10MainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(Phase10MainViewModel.Status));
            firstInfo.AddRow("Phase", nameof(Phase10MainViewModel.CurrentPhase));


            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 40); // 50 was too much.  if there is scrolling, i guess okay.
            AddAutoColumns(firstGrid, 1);     // maybe 1 (well see)
            AddLeftOverColumn(firstGrid, 15); // for other details
            AddLeftOverColumn(firstGrid, 30); // for scoreboard
            AddControlToGrid(firstGrid, otherStack, 0, 1);
            StackLayout firstStack = new StackLayout();

            firstStack.Children.Add(_playerHandWPF);
            var thisBut = GetSmallerButton("Complete" + Constants.vbCrLf + "Phase", nameof(Phase10MainViewModel.CompletePhaseAsync));

            firstStack.Children.Add(thisBut);
            AddControlToGrid(firstGrid, firstStack, 0, 0);
            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 2);
            AddControlToGrid(firstGrid, _score, 0, 3);
            AddControlToGrid(finalGrid, firstGrid, 0, 0);
            _tempG.Divider = 1.1;
            StackLayout thirdStack = new StackLayout();

            thirdStack.Orientation = StackOrientation.Horizontal;
            thirdStack.Children.Add(_tempG);
            thirdStack.Children.Add(_mainG);
            AddControlToGrid(finalGrid, thirdStack, 1, 0);



            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                otherStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = finalGrid;
        }
Exemplo n.º 25
0
        //private readonly Grid _setGrid;

        public FourSuitRummyMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     FourSuitRummyVMData model
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _discardGPile  = new BasePileXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _tempG         = new TempRummySetsXF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(FourSuitRummyMainViewModel.RestoreScreen));
            }

            Grid finalGrid = new Grid();

            AddAutoRows(finalGrid, 3);
            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 40);
            AddAutoColumns(firstGrid, 1);
            AddLeftOverColumn(firstGrid, 15);
            AddLeftOverColumn(firstGrid, 30);



            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            AddControlToGrid(firstGrid, otherStack, 0, 1);
            StackLayout firstStack = new StackLayout();

            firstStack.Children.Add(_playerHandWPF);
            var thisBut = GetGamingButton("Play Sets", nameof(FourSuitRummyMainViewModel.PlaySetsAsync));

            firstStack.Children.Add(thisBut);
            AddControlToGrid(firstGrid, firstStack, 0, 0);

            _score.AddColumn("Cards Left", true, nameof(FourSuitRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Score", true, nameof(FourSuitRummyPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(FourSuitRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(FourSuitRummyMainViewModel.Status));

            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 2);

            AddControlToGrid(firstGrid, _score, 0, 3);
            AddControlToGrid(finalGrid, firstGrid, 1, 0);
            StackLayout thirdStack = new StackLayout();

            thirdStack.Orientation = StackOrientation.Horizontal;
            thirdStack.Children.Add(_tempG);
            //_setGrid = new Grid();
            //thirdStack.Children.Add(_setGrid);
            Grid setgrid = new Grid();

            thirdStack.Children.Add(setgrid);
            AddControlToGrid(finalGrid, thirdStack, 2, 0);
            AddLeftOverColumn(setgrid, 50);
            AddLeftOverColumn(setgrid, 50);



            //var fins = new ParentSingleUIContainer(nameof(FourSuitRummyMainViewModel.OpponentSetsScreen));
            //AddControlToGrid(_setGrid, fins, 0, 1);
            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(FourSuitRummyMainViewModel.YourSetsScreen));

            AddControlToGrid(setgrid, parent, 0, 0);
            parent = new ParentSingleUIContainer(nameof(FourSuitRummyMainViewModel.OpponentSetsScreen));
            AddControlToGrid(setgrid, parent, 0, 1);

            //StackLayout temps = new StackLayout();
            //temps.Orientation = StackOrientation.Horizontal;
            //temps.Children.Add(parent);
            //temps.Children.Add(fins);
            //_setGrid.Children.Add(temps);



            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                otherStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = finalGrid;
        }
        public UnoMainView(IEventAggregator aggregator,
                           TestOptions test,
                           UnoVMData model
                           )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(UnoMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            var endButton = GetGamingButton("End Turn", nameof(UnoMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            otherStack.Children.Add(endButton);
            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(UnoMainViewModel.SayUnoScreen));

            otherStack.Children.Add(parent);

            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(UnoPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Points", true, nameof(UnoPlayerItem.TotalPoints), rightMargin: 10);
            _score.AddColumn("Previous Points", true, nameof(UnoPlayerItem.PreviousPoints), rightMargin: 10);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(UnoMainViewModel.NormalTurn));
            firstInfo.AddRow("Next", nameof(UnoMainViewModel.NextPlayer));
            firstInfo.AddRow("Status", nameof(UnoMainViewModel.Status));


            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_score);
            //this is only a starting point.


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP);              //default add to grid but does not have to.
            }
            UnoSaveInfo save = cons !.Resolve <UnoSaveInfo>(); //usually needs this part for multiplayer games.

            _score !.LoadLists(save.PlayerList);
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think
            _discardGPile !.Init(_model.Pile1 !, ts.TagUsed);            // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile();                   // its the main one.

            _deckGPile !.Init(_model.Deck1 !, ts.TagUsed);               // try here.  may have to do something else as well (?)
            _deckGPile.StartListeningMainDeck();


            Content = mainStack;
        }
Exemplo n.º 27
0
        public DutchBlitzMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  DutchBlitzVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>();
            _discardGPile = new BasePileXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>();
            _score        = new ScoreBoardXF();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(DutchBlitzMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(_public1);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft));
            _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound));
            _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status));
            firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage));


            var button = GetGamingButton("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync));

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_yourDiscard);
            otherStack.Children.Add(_yourStock);
            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);

            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_score);

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }

            GamePackageViewModelBinder.ManuelElements.Clear();               //often times i have to add manually.

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

            _score !.LoadLists(save.PlayerList);
            _discardGPile !.Init(_model.Pile1 !, "");  // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile(); // its the main one.

            _deckGPile !.Init(_model.Deck1 !, "");     // try here.  may have to do something else as well (?)
            _deckGPile.StartListeningMainDeck();
            _public1.Init(_model.PublicPiles1 !);
            _yourDiscard.Init(_model.DiscardPiles !, "");
            _yourStock.Init(_model.StockPile !.StockFrame, "");

            Content = mainStack;
        }
Exemplo n.º 28
0
        public CousinRummyMainView(IEventAggregator aggregator,
                                   TestOptions test,
                                   CousinRummyVMData model
                                   )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _discardGPile  = new BasePileXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _tempG         = new TempRummySetsXF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >();
            _mainG         = new MainRummySetsXF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard>, PhaseSet, SavedSet>();

            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(CousinRummyMainViewModel.RestoreScreen));
            }

            Grid buyGrid = new Grid();

            AddAutoColumns(buyGrid, 2);
            AddAutoRows(buyGrid, 1);
            AddPixelRow(buyGrid, 100);
            var button = GetSmallerButton("Pass", nameof(CousinRummyMainViewModel.PassAsync));

            AddControlToGrid(buyGrid, button, 0, 0);
            button = GetSmallerButton("Buy", nameof(CousinRummyMainViewModel.BuyAsync));
            AddControlToGrid(buyGrid, button, 0, 1);
            AddControlToGrid(buyGrid, _deckGPile, 1, 0);
            AddControlToGrid(buyGrid, _discardGPile, 1, 1);

            Grid gameGrid = new Grid();

            AddLeftOverRow(gameGrid, 45); // try that
            AddAutoRows(gameGrid, 1);
            AddLeftOverRow(gameGrid, 30);
            var otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_tempG);
            AddControlToGrid(gameGrid, otherStack, 0, 0);

            _score.AddColumn("Cards Left", false, nameof(CousinRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Tokens Left", false, nameof(CousinRummyPlayerItem.TokensLeft));
            _score.AddColumn("Current Score", false, nameof(CousinRummyPlayerItem.CurrentScore), rightMargin: 5);
            _score.AddColumn("Total Score", false, nameof(CousinRummyPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Normal Turn", nameof(CousinRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(CousinRummyMainViewModel.Status));
            firstInfo.AddRow("Other Turn", nameof(CousinRummyMainViewModel.OtherLabel));
            firstInfo.AddRow("Phase", nameof(CousinRummyMainViewModel.PhaseData));


            otherStack.Children.Add(_score);
            Grid bottomGrid = new Grid();

            AddLeftOverColumn(bottomGrid, 30);
            AddLeftOverColumn(bottomGrid, 70);
            otherStack = new StackLayout();
            button     = GetSmallerButton("Lay Down Initial Sets", nameof(CousinRummyMainViewModel.FirstSetsAsync));
            otherStack.Children.Add(button);
            button = GetSmallerButton("Lay Down Other Sets", nameof(CousinRummyMainViewModel.OtherSetsAsync)); // i think its othersets commands (?)
            otherStack.Children.Add(button);

            if (restoreP != null)
            {
                otherStack.Children.Add(restoreP); //default add to grid but does not have to.
            }

            AddControlToGrid(bottomGrid, otherStack, 0, 0);
            AddControlToGrid(bottomGrid, _mainG, 0, 1);
            AddControlToGrid(gameGrid, bottomGrid, 2, 0);
            otherStack                       = new StackLayout();
            otherStack.Orientation           = StackOrientation.Horizontal;
            _playerHandWPF.HorizontalOptions = LayoutOptions.StartAndExpand;
            otherStack.Children.Add(buyGrid);
            StackLayout tempStack = new StackLayout();

            tempStack.Children.Add(_playerHandWPF);
            tempStack.Children.Add(firstInfo.GetContent);
            otherStack.Children.Add(tempStack);
            AddControlToGrid(gameGrid, otherStack, 1, 0);

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);


            Content = gameGrid;
        }
Exemplo n.º 29
0
        public HitTheDeckMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  HitTheDeckVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckXF <HitTheDeckCardInformation, HitTheDeckGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <HitTheDeckCardInformation, HitTheDeckGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <HitTheDeckCardInformation, HitTheDeckGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(HitTheDeckMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            StackLayout tempStack = new StackLayout();

            otherStack.Children.Add(tempStack);
            Button otherButs;

            otherButs = GetGamingButton("Flip Deck", nameof(HitTheDeckMainViewModel.FlipAsync));
            tempStack.Children.Add(otherButs);
            otherButs = GetGamingButton("Cut Deck", nameof(HitTheDeckMainViewModel.CutAsync));
            tempStack.Children.Add(otherButs);
            var endButton = GetGamingButton("End Turn", nameof(HitTheDeckMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            tempStack.Children.Add(endButton);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(HitTheDeckPlayerItem.ObjectCount), rightMargin: 5);
            _score.AddColumn("Total Points", true, nameof(HitTheDeckPlayerItem.TotalPoints), rightMargin: 5);
            _score.AddColumn("Previous Points", true, nameof(HitTheDeckPlayerItem.PreviousPoints), rightMargin: 5);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(HitTheDeckMainViewModel.NormalTurn));
            firstInfo.AddRow("Next", nameof(HitTheDeckMainViewModel.NextPlayer));
            firstInfo.AddRow("Status", nameof(HitTheDeckMainViewModel.Status));


            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            mainStack.Children.Add(_score);


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public A8RoundRummyMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    A8RoundRummyVMData model,
                                    A8RoundRummyGameContainer gameContainer
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer = gameContainer;
            _deckGPile     = new BaseDeckXF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsXF>();
            _roundControl  = new RoundUI();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(A8RoundRummyMainViewModel.RestoreScreen));
            }

            Grid grid2 = new Grid();

            AddLeftOverColumn(grid2, 65);
            AddLeftOverColumn(grid2, 40); // can adjust as needed
            AddControlToGrid(grid2, mainStack, 0, 0);
            AddControlToGrid(grid2, _roundControl, 0, 1);



            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            var thisBut = GetGamingButton("Go Out", nameof(A8RoundRummyMainViewModel.GoOutAsync));

            otherStack.Children.Add(thisBut);
            mainStack.Children.Add(_playerHandWPF);
            _score.AddColumn("Cards Left", true, nameof(A8RoundRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Score", true, nameof(A8RoundRummyPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(A8RoundRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(A8RoundRummyMainViewModel.Status));
            firstInfo.AddRow("Next", nameof(A8RoundRummyMainViewModel.NextTurn));
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(_score);


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = grid2;
        }