public TileRummyMainView(IEventAggregator aggregator,
                                 TileRummyVMData model
                                 )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);


            _score = new ScoreBoardWPF();
            _hand1 = new BaseHandWPF <TileInfo, TileCP, TileWPF>();
            _pool1 = new BoneYardWPF <TileInfo, TileCP, TileWPF, TileShuffler>();
            _tempG = new TempRummySetsWPF <EnumColorType, EnumColorType, TileInfo, TileCP, TileWPF>();
            _mainG = new MainRummySetsWPF <EnumColorType, EnumColorType, TileInfo, TileCP, TileWPF, TileSet, SavedSet>();


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

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            var firstButton = GetGamingButton("Create First Sets", nameof(TileRummyMainViewModel.CreateFirstSetsAsync));
            var otherButton = GetGamingButton("Create New Set", nameof(TileRummyMainViewModel.CreateNewSetAsync));
            var undoButton  = GetGamingButton("Reset Moves", nameof(TileRummyMainViewModel.UndoMoveAsync));

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

            _tempG.Height = 250;
            _pool1.Width  = 300; // well see.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

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

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

            stack.Children.Add(firstButton);
            stack.Children.Add(otherButton);
            stack.Children.Add(undoButton);
            stack.Children.Add(endButton);
            otherStack.Children.Add(stack);
            stack = new StackPanel();
            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.
            Content = completeGrid;
        }
        public ItalianDominosMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      ItalianDominosVMData model
                                      )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            StackPanel mainStack = new StackPanel();

            ParentSingleUIContainer?restoreP = null;

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


            _bone          = new BoneYardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >();
            _playerHandWPF = new BaseHandWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >();
            _score         = new ScoreBoardWPF();
            _bone.Height   = 400;
            _bone.Width    = 800; //can adjust as needed.
            mainStack.Children.Add(_bone);
            mainStack.Children.Add(_playerHandWPF);

            //anything else to add can be done as well.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

            otherStack.Orientation = Orientation.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)
            {
                //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;
        }
Пример #3
0
        public DominosRegularMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      DominosRegularVMData model,
                                      IGamePackageResolver resolver
                                      )
        {
            _aggregator = aggregator;
            _model      = model;
            _resolver   = resolver;
            _aggregator.Subscribe(this);
            StackPanel mainStack = new StackPanel();

            ParentSingleUIContainer?restoreP = null;

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


            _bone          = new BoneYardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >();
            _playerHandWPF = new BaseHandWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >();
            _score         = new ScoreBoardWPF();
            _gameBoard1    = new GameBoardUI();
            _bone.Height   = 300;
            _bone.Width    = 800; //can adjust as needed.
            mainStack.Children.Add(_bone);
            mainStack.Children.Add(_gameBoard1);
            mainStack.Children.Add(_playerHandWPF);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            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.HorizontalAlignment = HorizontalAlignment.Left;
            mainStack.Children.Add(endTurn);



            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;
        }
Пример #4
0
        private readonly TrainStationWPF _trainG = new TrainStationWPF(); //has to be new because of linking issues.
        public DominosMexicanTrainMainView(IEventAggregator aggregator,
                                           TestOptions test,
                                           DominosMexicanTrainVMData model,
                                           IGamePackageRegister register,
                                           TrainStationGraphicsCP graphics
                                           )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            StackPanel mainStack = new StackPanel();

            register.RegisterControl(_trainG.Element, "");
            graphics.LinkBoard();
            ParentSingleUIContainer?restoreP = null;

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


            _bone          = new BoneYardWPF <MexicanDomino, ts, DominosWPF <MexicanDomino>, DominosBasicShuffler <MexicanDomino> >();
            _playerHandWPF = new BaseHandWPF <MexicanDomino, ts, DominosWPF <MexicanDomino> >();
            _score         = new ScoreBoardWPF();
            _playerTrain   = new BaseHandWPF <MexicanDomino, ts, DominosWPF <MexicanDomino> >();
            _bone.Height   = 500;
            _bone.Width    = 1050; //can adjust as needed.

            mainStack.Children.Add(_playerHandWPF);


            Grid otherGrid = new Grid();

            AddLeftOverColumn(otherGrid, 1);
            AddAutoColumns(otherGrid, 1);
            mainStack.Children.Add(otherGrid);
            StackPanel finalStack = new StackPanel();

            AddControlToGrid(otherGrid, finalStack, 0, 0);
            _trainG.Margin = new Thickness(5, 5, 5, 5);
            _trainG.HorizontalAlignment = HorizontalAlignment.Left;
            _trainG.VerticalAlignment   = VerticalAlignment.Top;
            AddControlToGrid(otherGrid, _trainG, 0, 1);
            finalStack.Children.Add(_bone);
            _playerTrain.HorizontalAlignment = HorizontalAlignment.Left;
            finalStack.Children.Add(_playerTrain);
            StackPanel tempstack = new StackPanel();

            tempstack.Orientation = Orientation.Horizontal;
            finalStack.Children.Add(tempstack);
            Button endbutton = GetGamingButton("End Turn", nameof(DominosMexicanTrainMainViewModel.EndTurnAsync));

            endbutton.HorizontalAlignment = HorizontalAlignment.Left;
            tempstack.Children.Add(endbutton);
            Button thisButton = GetGamingButton("Longest Train", nameof(DominosMexicanTrainMainViewModel.LongestTrain));

            tempstack.Children.Add(thisButton);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(DominosMexicanTrainMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DominosMexicanTrainMainViewModel.Status));
            _score.AddColumn("Dominos Left", true, nameof(DominosMexicanTrainPlayerItem.ObjectCount));
            _score.AddColumn("Total Score", true, nameof(DominosMexicanTrainPlayerItem.TotalScore));
            _score.AddColumn("Previous Score", true, nameof(DominosMexicanTrainPlayerItem.PreviousScore));
            _score.AddColumn("# Previous", true, nameof(DominosMexicanTrainPlayerItem.PreviousLeft));
            finalStack.Children.Add(_score);
            finalStack.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; //hopefully this is still it (?)
        }