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;
        }
Exemplo n.º 2
0
        public Spades2PlayerMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     Spades2PlayerVMData model
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _score         = new ScoreBoardXF();
            _trick1        = new TwoPlayerTrickXF <EnumSuitList, Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _playerHandWPF = new BaseHandXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();

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

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

            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(Spades2PlayerMainViewModel.BeginningScreen));

            mainStack.Children.Add(parent);

            _score.AddColumn("Cards", false, nameof(Spades2PlayerPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Bidded", false, nameof(Spades2PlayerPlayerItem.HowManyBids));
            _score.AddColumn("Won", false, nameof(Spades2PlayerPlayerItem.TricksWon));
            _score.AddColumn("Bags", false, nameof(Spades2PlayerPlayerItem.Bags));
            _score.AddColumn("C Score", false, nameof(Spades2PlayerPlayerItem.CurrentScore));
            _score.AddColumn("T Score", false, nameof(Spades2PlayerPlayerItem.TotalScore)); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();
            firstInfo.AddRow("Turn", nameof(Spades2PlayerMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(Spades2PlayerMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(Spades2PlayerMainViewModel.RoundNumber));

            mainStack.Children.Add(_trick1);
            parent = new ParentSingleUIContainer(nameof(Spades2PlayerMainViewModel.BiddingScreen));
            mainStack.Children.Add(parent);
            mainStack.Children.Add(_playerHandWPF);
            StackLayout other = new StackLayout();

            other.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(other);
            other.Children.Add(firstInfo.GetContent);
            other.Children.Add(_score);


            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 3
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;
        }
        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;
        }
Exemplo n.º 5
0
        public GermanWhistMainView(IEventAggregator aggregator,
                                   TestOptions test,
                                   GermanWhistVMData model
                                   )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(GermanWhistMainViewModel.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(GermanWhistPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Tricks Won", true, nameof(GermanWhistPlayerItem.TricksWon), rightMargin: 10);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

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

            _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.º 6
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 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;
        }
        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;
        }
Exemplo n.º 9
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;
        }
        public AgnesSolitaireMainView(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;

            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(_main);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(AgnesSolitaireMainViewModel.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(AgnesSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Starting Number", nameof(AgnesSolitaireMainViewModel.StartingNumber));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesXF();

            StackLayout tempStack = new StackLayout();

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

            //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.
            //if this is being used, then needs to hook to a viewmodel that is associated with this one.
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);


            Content = stack; //if not doing this, rethink.
        }
        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 RaglanSolitaireMainView(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     = GetSmallerButton("Auto Make Move", nameof(RaglanSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGridXF();

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

            _waste = new SolitairePilesXF();
            otherStack.Children.Add(_main);
            otherStack.Children.Add(_stock);
            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            StackLayout finalStack = new StackLayout();

            otherStack.Children.Add(finalStack);
            stack.Children.Add(otherStack);
            otherStack.Children.Add(_waste);
            finalStack.Children.Add(tempGrid);
            finalStack.Children.Add(autoBut);

            Content = stack; //if not doing this, rethink.
        }
        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.
        }
        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.
        }
        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.
        }
Exemplo n.º 16
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;
        }
        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;
        }
Exemplo n.º 19
0
        readonly DiceListControlXF <SimpleDice> _diceControl; //i think.
        public YachtRaceMainView(IEventAggregator aggregator,
                                 TestOptions test, YachtRaceVMData model
                                 )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model = model;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


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

            otherStack.Orientation = StackOrientation.Horizontal;
            _diceControl           = new DiceListControlXF <SimpleDice>();
            mainStack.Children.Add(_diceControl);
            otherStack.Children.Add(thisRoll);
            var endButton = GetGamingButton("Has 5 Of A Kind", nameof(YachtRaceMainViewModel.FiveKindAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            otherStack.Children.Add(endButton);
            mainStack.Children.Add(otherStack);
            _score = new ScoreBoardXF();
            _score.AddColumn("Time", true, nameof(YachtRacePlayerItem.Time));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

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


            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 SorryMainView(IEventAggregator aggregator,
                             TestOptions test,
                             GameBoardGraphicsCP graphicsCP, IGamePackageRegister register
                             )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            register.RegisterControl(_board.ThisElement, "");
            graphicsCP.LinkBoard();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


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

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

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


            mainStack.Children.Add(_board);


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


            AddVerticalLabelGroup("Card Details", nameof(SorryMainViewModel.CardDetails), mainStack);


            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 PokerMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckXF <PokerCardInfo, ts, DeckOfCardsXF <PokerCardInfo> >();
            StackLayout stack = new StackLayout();

            stack.Children.Add(_deckGPile);

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

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

            otherStack.Children.Add(_deckGPile);
            _bet        = new BetUI();
            _bet.Margin = new Thickness(40, 5, 10, 10);
            otherStack.Children.Add(_bet);
            var tempButton = GetSmallerButton("New Round", nameof(PokerMainViewModel.NewRoundAsync)); //maybe smallerbutton does not work

            //MakeGameButtonSmaller(tempButton);
            tempButton.HorizontalOptions = LayoutOptions.Start;
            tempButton.VerticalOptions   = LayoutOptions.Start;
            otherStack.Children.Add(tempButton);
            SimpleLabelGridXF thisLabel   = new SimpleLabelGridXF();
            CurrencyConverter thisConvert = new CurrencyConverter();

            thisLabel.AddRow("Money", nameof(PokerMainViewModel.Money), thisConvert);
            thisLabel.AddRow("Round", nameof(PokerMainViewModel.Round));
            thisLabel.AddRow("Winnings", nameof(PokerMainViewModel.Winnings), thisConvert);
            thisLabel.AddRow("Hand", nameof(PokerMainViewModel.HandLabel));
            stack.Children.Add(otherStack);
            stack.Children.Add(thisLabel.GetContent);

            _hand        = new HandUI(_aggregator);
            _hand.Margin = new Thickness(5);
            stack.Children.Add(_hand);


            Content = stack; //if not doing this, rethink.
        }
Exemplo n.º 22
0
        public SequenceDiceMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    SequenceDiceVMData model
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _board        = new GameBoardXF();
            _board.Margin = new Thickness(2);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            mainStack.Children.Add(_board);


            var         thisRoll   = GetGamingButton("Roll Dice", nameof(SequenceDiceMainViewModel.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);


            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(SequenceDiceMainViewModel.NormalTurn));
            firstInfo.AddRow("Instructions", nameof(SequenceDiceMainViewModel.Instructions));
            firstInfo.AddRow("Status", nameof(SequenceDiceMainViewModel.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;
        }
        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 ConcentrationMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     ConcentrationVMData model
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _board = new BasicMultiplePilesXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >();
            _score = new ScoreBoardXF();
            _score.AddColumn("Pairs", true, nameof(ConcentrationPlayerItem.Pairs)); //very common.
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_board);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", false, nameof(ConcentrationPlayerItem.ObjectCount)); //very common.
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

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

            StackLayout finalStack = new StackLayout();

            otherStack.Children.Add(finalStack);
            finalStack.Children.Add(firstInfo.GetContent);
            finalStack.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;
        }
        //private Button _button;
        public FroggiesMainView(IEventAggregator aggregator, FroggiesMainGameClass game)
        {
            //InputTransparent = true;
            //TestControl test = new TestControl();

            //Content = test;
            //GamePackageViewModelBinder.StopRun = true;
            //TestControl test = new TestControl();
            //Content = test;
            //_button = new Button()
            //{
            //    Text = "Main"
            //};
            //_button.Clicked += Button_Clicked;
            //Content = _button;
            aggregator.Subscribe(this);

            Grid thisGrid = new Grid();

            AddAutoColumns(thisGrid, 3);
            StackLayout stack = new StackLayout();
            GameBoardXF board = new GameBoardXF(aggregator, game, this);

            board.Margin = new Thickness(5, 5, 5, 5);
            stack.Margin = new Thickness(5, 5, 5, 5);

            AddControlToGrid(thisGrid, board, 0, 0);
            Button redoButton = GetGamingButton("Redo Game", nameof(FroggiesMainViewModel.RedoAsync));

            stack.Children.Add(redoButton);
            SimpleLabelGridXF thisLab = new SimpleLabelGridXF();

            thisLab.AddRow("Moves Left", nameof(FroggiesMainViewModel.MovesLeft));
            thisLab.AddRow("How Many Frogs Currently", nameof(FroggiesMainViewModel.NumberOfFrogs));
            thisLab.AddRow("How Many Frogs To Start", nameof(FroggiesMainViewModel.StartingFrogs));
            stack.Children.Add(thisLab.GetContent);
            AddControlToGrid(thisGrid, stack, 0, 1);
            TestControl test = new TestControl();

            AddControlToGrid(thisGrid, test, 0, 2);
            Content = thisGrid; //i think.
        }
Exemplo n.º 26
0
        private readonly DiceListControlXF <D> _diceControl; //hopefully still okay (?)



        public YahtzeeMainView(IEventAggregator aggregator, YahtzeeVMData <D> model)
        {
            _aggregator = aggregator;
            _aggregator.Publish(this);
            _model = model;
            _aggregator.Subscribe(this);
            _diceControl = new DiceListControlXF <D>();

            Grid eGrid = new Grid();

            GridHelper.AddLeftOverColumn(eGrid, 50);
            GridHelper.AddLeftOverColumn(eGrid, 50);
            ParentSingleUIContainer sheetGrid = new ParentSingleUIContainer(nameof(YahtzeeMainViewModel <D> .CurrentScoresheet));
            StackLayout             stack     = new StackLayout();

            stack.Children.Add(sheetGrid);

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(YahtzeeMainViewModel <D> .NormalTurn));
            firstInfo.AddRow("Roll", nameof(YahtzeeMainViewModel <D> .RollNumber)); // its bound now.
            firstInfo.AddRow("Status", nameof(YahtzeeMainViewModel <D> .Status));
            firstInfo.AddRow("Turn #", nameof(YahtzeeMainViewModel <D> .Round));    // i think
            stack.Children.Add(firstInfo.GetContent);
            _score = new ScoreBoardXF();
            _score.AddColumn("Points", false, nameof(YahtzeePlayerItem <D> .Points));
            _score.HorizontalOptions = LayoutOptions.Start;
            _score.VerticalOptions   = LayoutOptions.Start;
            var thisRoll = GetGamingButton("Roll Dice", nameof(YahtzeeMainViewModel <D> .RollDiceAsync));

            stack.Children.Add(_diceControl);

            stack.Children.Add(eGrid);
            StackLayout finalStack = new StackLayout();

            GridHelper.AddControlToGrid(eGrid, finalStack, 0, 0); //try this too.
            finalStack.Children.Add(thisRoll);
            finalStack.Children.Add(_score);
            GridHelper.AddControlToGrid(eGrid, firstInfo.GetContent, 0, 1);

            Content = stack;
        }
Exemplo n.º 27
0
        public MinesweeperMainView(IEventAggregator aggregator, MinesweeperMainGameClass game)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            Grid grid = new Grid();

            AddLeftOverColumn(grid, 1); //well see how this works (?)
            AddLeftOverColumn(grid, 1);
            GameboardXF gameboard = new GameboardXF(game);

            AddControlToGrid(grid, gameboard, 0, 0);
            _gameboard = gameboard;

            StackLayout       stack   = new StackLayout();
            SimpleLabelGridXF thisLab = new SimpleLabelGridXF();

            thisLab.AddRow("Mines Needed", nameof(MinesweeperMainViewModel.HowManyMinesNeeded));
            thisLab.AddRow("Mines Left", nameof(MinesweeperMainViewModel.NumberOfMinesLeft));
            thisLab.AddRow("Level Chosen", nameof(MinesweeperMainViewModel.LevelChosen)); //hopefully this simple (?)

            //i do like the buttons first.
            Button          button    = GetGamingButton("", nameof(MinesweeperMainViewModel.ChangeFlag));
            Binding         binding   = new Binding(nameof(MinesweeperMainViewModel.IsFlagging));
            IValueConverter converter = new ToggleNameConverter();

            binding.Converter = converter;
            button.SetBinding(Button.TextProperty, binding);

            binding           = new Binding(nameof(MinesweeperMainViewModel.IsFlagging));
            converter         = new ToggleColorConverter();
            binding.Converter = converter;
            button.SetBinding(BackgroundColorProperty, binding);

            stack.Children.Add(button);
            button.Margin            = new Thickness(5);
            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            stack.Children.Add(thisLab.GetContent);
            AddControlToGrid(grid, stack, 0, 1);
            Content = grid;
        }
Exemplo n.º 28
0
        public BlockElevenSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            var scoresAlone = new SimpleLabelGridXF();

            scoresAlone.AddRow("Score", nameof(BlockElevenSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Cards Left", nameof(BlockElevenSolitaireMainViewModel.CardsLeft));
            var tempGrid = scoresAlone.GetContent;

            _waste = new BasicMultiplePilesXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >();

            otherStack.Children.Add(_waste);
            otherStack.Children.Add(tempGrid);

            Content = otherStack; //if not doing this, rethink.
        }
        public LottoDominosMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    LottoDominosMainGameClass mainGame
                                    )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _mainGame = mainGame;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            ParentSingleUIContainer choose = new ParentSingleUIContainer(nameof(LottoDominosMainViewModel.ChooseScreen));

            mainStack.Children.Add(choose);
            ParentSingleUIContainer board = new ParentSingleUIContainer(nameof(LottoDominosMainViewModel.BoardScreen));

            mainStack.Children.Add(board);

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(LottoDominosMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(LottoDominosMainViewModel.Status));
            mainStack.Children.Add(firstInfo.GetContent);
            _score1 = new ScoreBoardXF();
            _score1.AddColumn("# Chosen", true, nameof(LottoDominosPlayerItem.NumberChosen));
            _score1.AddColumn("# Won", true, nameof(LottoDominosPlayerItem.NumberWon));
            mainStack.Children.Add(_score1);

            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.º 30
0
        readonly DiceListControlXF <TenSidedDice> _diceControl; //i think.
        public DeadDie96MainView(IEventAggregator aggregator,
                                 TestOptions test, DeadDie96VMData model
                                 )
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _model = model;
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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


            var thisRoll = GetGamingButton("Roll Dice", nameof(DeadDie96MainViewModel.RollDiceAsync));

            _diceControl = new DiceListControlXF <TenSidedDice>();
            mainStack.Children.Add(_diceControl);
            mainStack.Children.Add(thisRoll);

            _score = new ScoreBoardXF();
            _score.AddColumn("Current Score", true, nameof(DeadDie96PlayerItem.CurrentScore));
            _score.AddColumn("Total Score", true, nameof(DeadDie96PlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(DeadDie96MainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Status", nameof(DeadDie96MainViewModel.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;
        }