Beispiel #1
0
        public ConnectFourMainView(IEventAggregator aggregator,
                                   TestOptions test
                                   )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(ConnectFourMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(ConnectFourMainViewModel.Status));
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_board);
            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 BeleaguredCastleMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            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);
            var autoBut = GetGamingButton("Auto Make Move", nameof(BeleaguredCastleMainViewModel.AutoMoveAsync));

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

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

            _waste = new CustomWasteUI();
            stack.Children.Add(_waste);
            stack.Children.Add(otherStack);

            otherStack.Children.Add(tempGrid);
            otherStack.Children.Add(autoBut);
            Content = stack; //if not doing this, rethink.
        }
Beispiel #3
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;
        }
Beispiel #4
0
        public PersianSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            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);
            var autoBut     = GetSmallerButton("Auto Make Move", nameof(PersianSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(PersianSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Deal", nameof(PersianSolitaireMainViewModel.DealNumber));
            var finalButton = GetSmallerButton("New Deal", nameof(PersianSolitaireMainViewModel.NewDeal));
            var tempGrid    = scoresAlone.GetContent;

            _waste = new SolitairePilesXF();
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            stack.Children.Add(finalButton);
            otherStack.Children.Add(stack);
            Content = otherStack; //if not doing this, rethink.
        }
        public RageBiddingView(IEventAggregator aggregator, RageCardGameVMData model, RageCardGameGameContainer gameContainer)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackLayout     stack = new StackLayout();
            NumberChooserXF bid   = new NumberChooserXF();
            BaseHandXF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF> hand = new BaseHandXF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsXF>();
            ScoreBoardXF score = new ScoreBoardXF();

            RageCardGameMainView.PopulateScores(score);
            Button            button  = GetGamingButton("Submit", nameof(RageBiddingViewModel.BidAsync));
            SimpleLabelGridXF bidInfo = new SimpleLabelGridXF();

            bidInfo.AddRow("Trump", nameof(RageBiddingViewModel.TrumpSuit));
            bidInfo.AddRow("Turn", nameof(RageBiddingViewModel.NormalTurn));
            stack.Children.Add(bid);
            stack.Children.Add(button);
            stack.Children.Add(hand);
            stack.Children.Add(bidInfo.GetContent);
            stack.Children.Add(score);
            Content = stack;
            score !.LoadLists(gameContainer.SaveRoot.PlayerList);
            hand !.LoadList(model.PlayerHand1 !, "");
            bid !.LoadLists(model.Bid1);
        }
Beispiel #6
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 MancalaMainView(IEventAggregator aggregator,
                               TestOptions test,
                               IGamePackageRegister register
                               )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _register = register;
            _register.RegisterControl(_board.Element, "");
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(MancalaMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(MancalaMainViewModel.Status));
            firstInfo.AddRow("Instructions", nameof(MancalaMainViewModel.Instructions));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_board);
            otherStack.Children.Add(firstInfo.GetContent);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public HeapSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            StackLayout stack = new StackLayout();

            _mainPile        = new BasicMultiplePilesXF <HeapSolitaireCardInfo, ts, DeckOfCardsXF <HeapSolitaireCardInfo> >();
            _wastePile       = new CustomWasteUI();
            _mainPile.Margin = new Thickness(5);
            stack.Children.Add(_mainPile);
            StackLayout others = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            stack.Children.Add(others);
            others.Children.Add(_wastePile);
            StackLayout       finalStack  = new StackLayout();
            SimpleLabelGridXF scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(HeapSolitaireMainViewModel.Score));
            finalStack.Children.Add(scoresAlone.GetContent);
            others.Children.Add(finalStack);
            Content = stack; //if not doing this, rethink.
        }
        //private readonly StackPanel _stack;
        public BeginningChooseColorView(IEventAggregator aggregator, IBeginningColorModel <E, GC> model)
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            StackLayout stack = new StackLayout();

            _color = new EnumPickerXF <GC, GW, E>();
            if (BeginningColorDimensions.GraphicsHeight > 0)
            {
                _color.GraphicsHeight = BeginningColorDimensions.GraphicsHeight;
            }
            if (BeginningColorDimensions.GraphicsWidth > 0)
            {
                _color.GraphicsWidth = BeginningColorDimensions.GraphicsWidth;
            }
            stack.Children.Add(_color);
            SimpleLabelGridXF simple = new SimpleLabelGridXF();

            simple.AddRow("Turn", nameof(IBeginningColorViewModel.Turn));
            simple.AddRow("Instructions", nameof(IBeginningColorViewModel.Instructions));
            stack.Children.Add(simple.GetContent);

            Content = stack;
        }
Beispiel #10
0
        public TicTacToeMainView(IEventAggregator aggregator,
                                 TestOptions test
                                 )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TicTacToeMainViewModel.RestoreScreen));
            }
            _board = new GameBoardXF();
            mainStack.Children.Add(_board);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(TicTacToeMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(TicTacToeMainViewModel.Status)); // this may have to show the status to begin with (?)
            mainStack.Children.Add(firstInfo.GetContent);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public BakersDozenSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            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);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(BakersDozenSolitaireMainViewModel.AutoMoveAsync));

            autoBut.HorizontalOptions = LayoutOptions.Start;
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(BakersDozenSolitaireMainViewModel.Score));
            var         tempGrid   = scoresAlone.GetContent;
            StackLayout finalStack = new StackLayout();

            otherStack.Children.Add(finalStack);
            otherStack.Children.Add(_main);
            finalStack.Children.Add(tempGrid);
            finalStack.Children.Add(autoBut);
            _waste = new SolitairePilesXF();
            stack.Children.Add(_waste);


            Content = stack; //if not doing this, rethink.
        }
Beispiel #12
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;
        }
Beispiel #13
0
        public SnakesAndLaddersMainView(IEventAggregator aggregator,
                                        TestOptions test, SnakesAndLaddersMainGameClass mainGame,
                                        SnakesAndLaddersVMData model
                                        )
        {
            _aggregator = aggregator;
            _mainGame   = mainGame;
            _model      = model;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            _privateBoard                   = new GameboardXF();
            _privateBoard.Margin            = new Thickness(5, 5, 5, 5);
            _privateBoard.HorizontalOptions = LayoutOptions.Start;
            _privateBoard.VerticalOptions   = LayoutOptions.Start;
            mainStack.Children.Add(_privateBoard);
            var         thisRoll   = GetGamingButton("Roll Dice", nameof(SnakesAndLaddersMainViewModel.RollDiceAsync));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <SimpleDice>();
            otherStack.Children.Add(thisRoll);
            _pieceTurn = new GamePieceXF();
            if (ScreenUsed == EnumScreen.SmallPhone)
            {
                _pieceTurn.WidthRequest  = 40;
                _pieceTurn.HeightRequest = 40;
            }
            else
            {
                _pieceTurn.WidthRequest  = 90;
                _pieceTurn.HeightRequest = 90;
            }
            _pieceTurn.Margin         = new Thickness(10, 0, 0, 0);
            _pieceTurn.NeedsSubscribe = false; // won't notify in this case.  just let them know when new turn.  otherwise, when this number changes, it will trigger for the gameboard (which is not good)
            _pieceTurn.Init();
            otherStack.Children.Add(_pieceTurn);
            otherStack.Children.Add(_diceControl);
            mainStack.Children.Add(otherStack);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(SnakesAndLaddersMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(SnakesAndLaddersMainViewModel.Status));
            mainStack.Children.Add(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;
        }
        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.
        }
Beispiel #15
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;
        }
Beispiel #18
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;
        }
Beispiel #19
0
        public BowlingDiceGameMainView(IEventAggregator aggregator,
                                       TestOptions test, IGamePackageResolver resolver
                                       )
        {
            _aggregator = aggregator;
            _resolver   = resolver;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(BowlingDiceGameMainViewModel.RestoreScreen));
            }
            _completeBoard = new BowlingCompleteScoresheetXF();
            mainStack.Children.Add(_completeBoard);
            StackLayout tempStack = new StackLayout();

            tempStack.Orientation = StackOrientation.Horizontal;
            var button = GetGamingButton("Roll", nameof(BowlingDiceGameMainViewModel.RollAsync));

            _diceBoard = new DiceListXF();
            tempStack.Children.Add(_diceBoard);
            tempStack.Children.Add(button);    // the roll dice should be on the right side
            mainStack.Children.Add(tempStack); // hopefully thissimple

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(BowlingDiceGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Frame", nameof(BowlingDiceGameMainViewModel.WhatFrame)); // i think so we know what frame its on.
            firstInfo.AddRow("Status", nameof(BowlingDiceGameMainViewModel.Status));
            mainStack.Children.Add(firstInfo.GetContent);

            button = GetGamingButton("Continue", nameof(BowlingDiceGameMainViewModel.ContinueTurnAsync));
            button.HorizontalOptions = LayoutOptions.Start;
            mainStack.Children.Add(button);
            var endButton = GetGamingButton("End Turn", nameof(BowlingDiceGameMainViewModel.EndTurnAsync));

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

            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.
            }
            GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually.
            var mainGame = _resolver.Resolve <BowlingDiceGameMainGameClass>();

            _completeBoard.LoadPlayerScores();
            _diceBoard.LoadBoard(mainGame.DiceBoard !.DiceList);
            Content = mainStack;
        }
        readonly DiceListControlXF <EightSidedDice> _diceControl; //i think.
        public SinisterSixMainView(IEventAggregator aggregator,
                                   TestOptions test, SinisterSixVMData model
                                   )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model = model;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


            var         thisRoll   = GetGamingButton("Roll Dice", nameof(SinisterSixMainViewModel.RollDiceAsync));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <EightSidedDice>();
            otherStack.Children.Add(_diceControl);
            otherStack.Children.Add(thisRoll);
            var endButton = GetGamingButton("End Turn", nameof(SinisterSixMainViewModel.EndTurnAsync));

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

            var otherButton = GetGamingButton("Remove Selected Dice", nameof(SinisterSixMainViewModel.RemoveDiceAsync));

            otherButton.HorizontalOptions = LayoutOptions.Start;
            mainStack.Children.Add(otherButton);

            _score = new ScoreBoardXF();
            _score.AddColumn("Score", true, nameof(SinisterSixPlayerItem.Score));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(SinisterSixMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Roll", nameof(SinisterSixMainViewModel.RollNumber)); //if you don't need, it comment it out.
            firstInfo.AddRow("Status", nameof(SinisterSixMainViewModel.Status));



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

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public TroubleMainView(IEventAggregator aggregator,
                               TestOptions test,
                               TroubleVMData model,
                               TroubleGameContainer gameContainer,
                               GameBoardGraphicsCP graphicsCP,
                               IGamePackageRegister register
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _graphicsCP = graphicsCP;
            _aggregator.Subscribe(this);
            gameContainer.PositionDice = PositionDice;
            register.RegisterControl(_board.ThisElement, "");
            graphicsCP.LinkBoard();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TroubleMainViewModel.RestoreScreen));
            }
            _tempGrid.Margin    = new Thickness(5, 5, 5, 5);
            _diceControl        = new DiceListControlXF <SimpleDice>();
            _diceControl.Margin = new Thickness(10, 0, 0, 0);

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

            endButton.HorizontalOptions = LayoutOptions.Start;


            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

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


            mainStack.Children.Add(_tempGrid);
            mainStack.Children.Add(firstInfo.GetContent);
            _tempStack.Children.Add(_diceControl);
            _tempStack.InputTransparent = true; //maybe this will be okay.
            _tempGrid.Children.Add(_board);


            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;
        }
Beispiel #22
0
        public CountdownMainView(IEventAggregator aggregator,
                                 TestOptions test, CountdownVMData model,
                                 CountdownGameContainer gameContainer
                                 )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model         = model;
            _gameContainer = gameContainer;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(CountdownMainViewModel.RestoreScreen));
            }
            mainStack.Children.Add(_playerStack);

            var         thisRoll   = GetGamingButton("Roll Dice", nameof(CountdownMainViewModel.RollDiceAsync));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <CountdownDice>();
            otherStack.Children.Add(_diceControl);
            otherStack.Children.Add(thisRoll);
            var endButton = GetGamingButton("End Turn", nameof(CountdownMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            var otherButton = GetGamingButton("Show Hints", nameof(CountdownMainViewModel.Hint));

            otherButton.HorizontalOptions = LayoutOptions.Start;

            otherStack.Children.Add(endButton);
            otherStack.Children.Add(otherButton);
            mainStack.Children.Add(otherStack);

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(CountdownMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Round", nameof(CountdownMainViewModel.Round));     //if you don't need, it comment it out.
            firstInfo.AddRow("Status", nameof(CountdownMainViewModel.Status));


            mainStack.Children.Add(firstInfo.GetContent);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            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 ItalianDominosMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      ItalianDominosVMData model
                                      )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            StackLayout mainStack = new StackLayout();

            ParentSingleUIContainer?restoreP = null;

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


            _bone               = new BoneYardXF <SimpleDominoInfo, ts, DominosXF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >();
            _playerHandXF       = new BaseHandXF <SimpleDominoInfo, ts, DominosXF <SimpleDominoInfo> >();
            _score              = new ScoreBoardXF();
            _bone.HeightRequest = 130;
            _bone.WidthRequest  = 600;
            mainStack.Children.Add(_bone);
            mainStack.Children.Add(_playerHandXF);

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(ItalianDominosMainViewModel.NormalTurn));
            firstInfo.AddRow("Up To", nameof(ItalianDominosMainViewModel.UpTo));
            firstInfo.AddRow("Next #", nameof(ItalianDominosMainViewModel.NextNumber));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            var thisBut = GetGamingButton("Play", nameof(ItalianDominosMainViewModel.PlayAsync));

            otherStack.Children.Add(thisBut);
            _score.AddColumn("Total Score", true, nameof(ItalianDominosPlayerItem.TotalScore), rightMargin: 10);
            _score.AddColumn("Dominos Left", true, nameof(ItalianDominosPlayerItem.ObjectCount), rightMargin: 10); // if not important, can just comment
            _score.AddColumn("Drew Yet", true, nameof(ItalianDominosPlayerItem.DrewYet), useTrueFalse: true);
            otherStack.Children.Add(firstInfo.GetContent);
            otherStack.Children.Add(_score);
            mainStack.Children.Add(otherStack); // this may be missing as well.

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

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

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

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", false, nameof(CaliforniaJackPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Tricks Won", true, nameof(CaliforniaJackPlayerItem.TricksWon), rightMargin: 10);
            _score.AddColumn("Points", true, nameof(CaliforniaJackPlayerItem.Points), rightMargin: 10);
            _score.AddColumn("Total Score", true, nameof(CaliforniaJackPlayerItem.TotalScore), rightMargin: 10);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(CaliforniaJackMainViewModel.NormalTurn));
            firstInfo.AddRow("Trump", nameof(CaliforniaJackMainViewModel.TrumpSuit));
            firstInfo.AddRow("Status", nameof(CaliforniaJackMainViewModel.Status));
            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);


            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 ChessMainView(IEventAggregator aggregator,
                             TestOptions test, IGamePackageRegister register,
                             GameBoardGraphicsCP graphics)
        {
            _aggregator = aggregator;
            _register   = register;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(ChessMainViewModel.RestoreScreen));
            }
            _register.RegisterControl(_board.Element, "main");
            graphics.LinkBoard(); //this is always needed now.
            _board.Margin = new Thickness(3);

            mainStack.Children.Add(_board);
            var endButton = GetGamingButton("End Turn", nameof(ChessMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            Button other = GetGamingButton("Show Tie", nameof(ChessMainViewModel.TieAsync));

            other.HorizontalOptions = LayoutOptions.Start;
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(ChessMainViewModel.NormalTurn));
            firstInfo.AddRow("Instructions", nameof(ChessMainViewModel.Instructions));
            firstInfo.AddRow("Status", nameof(ChessMainViewModel.Status));
            StackLayout tempStack = new StackLayout();

            tempStack.Orientation = StackOrientation.Horizontal;
            tempStack.Children.Add(endButton);
            tempStack.Children.Add(other);
            tempStack.Children.Add(firstInfo.GetContent);

            StackLayout finalStack = new StackLayout();

            finalStack.Children.Add(tempStack);
            finalStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(finalStack);

            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;
        }
Beispiel #27
0
        readonly DiceListControlXF <SimpleDice> _diceControl; //i think.
        public A21DiceGameMainView(IEventAggregator aggregator,
                                   TestOptions test, A21DiceGameVMData model
                                   )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model = model;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


            var         thisRoll   = GetGamingButton("Roll Dice", nameof(A21DiceGameMainViewModel.RollDiceAsync));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <SimpleDice>();
            otherStack.Children.Add(_diceControl);
            otherStack.Children.Add(thisRoll);
            var endButton = GetGamingButton("End Turn", nameof(A21DiceGameMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            otherStack.Children.Add(endButton);
            mainStack.Children.Add(otherStack);
            _score = new ScoreBoardXF();
            _score.AddColumn("# Of Rolls", true, nameof(A21DiceGamePlayerItem.NumberOfRolls));
            _score.AddColumn("Score", true, nameof(A21DiceGamePlayerItem.Score));
            _score.AddColumn("Was Tie", true, nameof(A21DiceGamePlayerItem.IsFaceOff), useTrueFalse: true);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(A21DiceGameMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Status", nameof(A21DiceGameMainViewModel.Status));

            //this is just a starting point.

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

            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;
        }
        readonly DiceListControlXF <SimpleDice> _diceControl; //i think.
        public ShipCaptainCrewMainView(IEventAggregator aggregator,
                                       TestOptions test, ShipCaptainCrewVMData model
                                       )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model = model;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


            var         thisRoll   = GetGamingButton("Roll Dice", nameof(ShipCaptainCrewMainViewModel.RollDiceAsync));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <SimpleDice>();
            otherStack.Children.Add(_diceControl);
            otherStack.Children.Add(thisRoll);
            mainStack.Children.Add(otherStack);
            _score = new ScoreBoardXF();
            _score.UseAbbreviationForTrueFalse = false;
            _score.AddColumn("Score", true, nameof(ShipCaptainCrewPlayerItem.Score));
            _score.AddColumn("Out", true, nameof(ShipCaptainCrewPlayerItem.WentOut), useTrueFalse: true);
            _score.AddColumn("Wins", true, nameof(ShipCaptainCrewPlayerItem.Wins));

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(ShipCaptainCrewMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Roll", nameof(ShipCaptainCrewMainViewModel.RollNumber)); //if you don't need, it comment it out.
            firstInfo.AddRow("Status", nameof(ShipCaptainCrewMainViewModel.Status));

            //this is just a starting point.

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

            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 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;
        }
        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;
        }