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;
        }
        //private readonly ScoreBoardXF _score;
        public DominosMexicanTrainMainView(IEventAggregator aggregator,
                                           TestOptions test
                                           //DominosMexicanTrainVMData model
                                           )
        {
            _aggregator = aggregator;
            //_model = model;
            _aggregator.Subscribe(this);
            StackLayout mainStack = new StackLayout();

            ParentSingleUIContainer?restoreP = null;

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


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

            //anything else to add can be done as well.


            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 TileRummyMainView(IEventAggregator aggregator,
                                 TileRummyVMData model,
                                 TestOptions test
                                 )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);


            _score = new ScoreBoardXF();
            _hand1 = new BaseHandXF <TileInfo, TileCP, TileXF>();
            _pool1 = new BoneYardXF <TileInfo, TileCP, TileXF, TileShuffler>();
            _tempG = new TempRummySetsXF <EnumColorType, EnumColorType, TileInfo, TileCP, TileXF>();
            _mainG = new MainRummySetsXF <EnumColorType, EnumColorType, TileInfo, TileCP, TileXF, TileSet, SavedSet>();

            var endButton = GetSmallerButton("End Turn", nameof(TileRummyMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;
            var firstButton = GetSmallerButton("Create First Sets", nameof(TileRummyMainViewModel.CreateFirstSetsAsync));
            var otherButton = GetSmallerButton("Create New Set", nameof(TileRummyMainViewModel.CreateNewSetAsync));
            var undoButton  = GetSmallerButton("Reset Moves", nameof(TileRummyMainViewModel.UndoMoveAsync));

            _score.AddColumn("Tiles Left", true, nameof(TileRummyPlayerItem.ObjectCount));
            _score.AddColumn("Score", true, nameof(TileRummyPlayerItem.Score));

            if (ScreenUsed == EnumScreen.SmallTablet)
            {
                _tempG.HeightRequest = 120;
            }
            else
            {
                _tempG.HeightRequest = 200;
            }
            _pool1.WidthRequest = 250;

            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(TileRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(TileRummyMainViewModel.Status));
            var  firstContent = firstInfo.GetContent;
            Grid completeGrid = new Grid();

            AddLeftOverRow(completeGrid, 55);
            AddAutoRows(completeGrid, 1);
            AddLeftOverRow(completeGrid, 50);
            AddAutoRows(completeGrid, 1);
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_pool1);
            StackLayout stack = new StackLayout();

            stack.Children.Add(firstButton);
            stack.Children.Add(otherButton);
            stack.Children.Add(undoButton);
            stack.Children.Add(endButton);
            otherStack.Children.Add(stack);
            stack = new StackLayout();
            stack.Children.Add(_tempG);
            stack.Children.Add(firstContent);
            stack.Children.Add(_score);
            otherStack.Children.Add(stack);
            AddControlToGrid(completeGrid, otherStack, 0, 0);
            AddControlToGrid(completeGrid, _hand1, 1, 0);
            _pool1.Margin = new Thickness(2, 2, 2, 2);
            AddControlToGrid(completeGrid, _mainG, 2, 0); // used the wrong one.

            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TileRummyMainViewModel.RestoreScreen));
            }
            if (restoreP != null)
            {
                AddControlToGrid(completeGrid, restoreP, 3, 0); //default add to grid but does not have to.
            }


            Content = completeGrid;
        }
Example #4
0
        public DominosRegularMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      DominosRegularVMData model,
                                      IGamePackageResolver resolver
                                      )
        {
            _aggregator = aggregator;
            _model      = model;
            _resolver   = resolver;
            _aggregator.Subscribe(this);
            StackLayout mainStack = new StackLayout();

            _gameBoard1 = new GameBoardUI();
            ParentSingleUIContainer?restoreP = null;

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


            _bone         = new BoneYardXF <SimpleDominoInfo, ts, DominosXF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >();
            _playerHandXF = new BaseHandXF <SimpleDominoInfo, ts, DominosXF <SimpleDominoInfo> >();
            _score        = new ScoreBoardXF();
            if (ScreenUsed != EnumScreen.SmallPhone)
            {
                _bone.HeightRequest = 300;
            }
            else
            {
                _bone.HeightRequest = 90;
            }
            _bone.WidthRequest = 300;
            mainStack.Children.Add(_bone);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(DominosRegularMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DominosRegularMainViewModel.Status));
            mainStack.Children.Add(firstInfo.GetContent);
            _score.AddColumn("Total Score", true, nameof(DominosRegularPlayerItem.TotalScore));
            _score.AddColumn("Dominos Left", true, nameof(DominosRegularPlayerItem.ObjectCount)); // if not important, can just comment
            mainStack.Children.Add(_score);
            Button endTurn = GetGamingButton("End Turn", nameof(DominosRegularMainViewModel.EndTurnAsync));

            endTurn.HorizontalOptions = LayoutOptions.Start;

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_gameBoard1);
            mainStack.Children.Add(_playerHandXF);
            otherStack.Children.Add(firstInfo.GetContent);
            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_score);
            otherStack.Children.Add(endTurn);
            mainStack.Children.Add(otherStack);



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