public MainBoardView(GameBoardCP boardcp)
        {
            CardBoardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> > boardui = new CardBoardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >();

            Content = boardui;
            boardui.LoadList(boardcp, ts.TagUsed);
            //hopefully this simple this time.
        }
        public DiceDominosMainView(IEventAggregator aggregator,
                                   TestOptions test, DiceDominosVMData model,
                                   GameBoardCP gameBoard
                                   )
        {
            _aggregator = aggregator;
            _model      = model;
            _gameBoard  = gameBoard;
            _aggregator.Subscribe(this);
            StackPanel mainStack = new StackPanel();

            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(DiceDominosMainViewModel.RestoreScreen)
                };
            }
            _gameBoard1 = new CardBoardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >();
            mainStack.Children.Add(_gameBoard1);
            var        thisRoll   = GetGamingButton("Roll Dice", nameof(DiceDominosMainViewModel.RollDiceAsync));
            StackPanel otherStack = new StackPanel();

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

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(endButton);
            _score = new ScoreBoardWPF();
            //anything you need for the scoreboard.
            _score.AddColumn("Dominos Won", true, nameof(DiceDominosPlayerItem.DominosWon), rightMargin: 10);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(DiceDominosMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Status", nameof(DiceDominosMainViewModel.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.º 3
0
        public PyramidSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile           = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel stack = new StackPanel();

            _currentCard = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _playerBoard = new CardBoardWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _triangle    = new TriangleWPF();
            var playButton = GetGamingButton("Play Selected Cards", nameof(PyramidSolitaireMainViewModel.PlaySelectedCardsAsync));

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;

            StackPanel other = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

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

            playButton.HorizontalAlignment = HorizontalAlignment.Left;
            playButton.VerticalAlignment   = VerticalAlignment.Top;
            stack.Children.Add(playButton);
            var thisLabel = new SimpleLabelGrid();

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

            Content = stack; //if not doing this, rethink.
        }
Exemplo n.º 4
0
        public FirstView(GolfCardGameVMData model, IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            SimpleLabelGrid label = new SimpleLabelGrid();

            label.AddRow("Instructions", nameof(FirstViewModel.Instructions));
            _aggregator.Subscribe(this);
            _beginXF = new CardBoardWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _model   = model;
            StackPanel stack = new StackPanel();
            StackPanel other = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            other.Children.Add(_beginXF);
            Button button = GetGamingButton("Choose First Cards", nameof(FirstViewModel.ChooseFirstCardsAsync));

            other.Children.Add(button);
            stack.Children.Add(other);
            stack.Children.Add(label.GetContent);
            Content = stack;
        }
Exemplo n.º 5
0
        public OpetongMainView(IEventAggregator aggregator,
                               TestOptions test,
                               OpetongVMData model
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();

            _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard>, RummySet, SavedSet>();
            _poolG = new CardBoardWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();


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

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_poolG);
            _poolG.HorizontalAlignment = HorizontalAlignment.Left;
            _poolG.VerticalAlignment   = VerticalAlignment.Top;
            _tempG.Height = 350;
            otherStack.Children.Add(_tempG);
            var button = GetGamingButton("Lay Down Single Set", nameof(OpetongMainViewModel.PlaySetAsync));

            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(OpetongPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Sets Played", true, nameof(OpetongPlayerItem.SetsPlayed));
            _score.AddColumn("Score", true, nameof(OpetongPlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

            StackPanel finalStack = new StackPanel();

            finalStack.Children.Add(_score);
            finalStack.Children.Add(firstInfo.GetContent);
            otherStack.Children.Add(finalStack);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(_mainG);


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



            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Exemplo n.º 6
0
        public GolfCardGameMainView(IEventAggregator aggregator,
                                    TestOptions test,
                                    GolfCardGameVMData model,
                                    GolfCardGameGameContainer gameContainer
                                    )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _discardGPile = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _score        = new ScoreBoardWPF();

            _hiddenWPF    = new BasicMultiplePilesWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _otherPileWPF = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _golfWPF      = new CardBoardWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();


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

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


            StackPanel otherStack = new StackPanel();

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

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

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

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

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

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


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

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

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


            _otherPileWPF !.Init(_model.OtherPile !, ts.TagUsed);
            _hiddenWPF !.Init(_model.HiddenCards1 !, ts.TagUsed);
            _golfWPF !.LoadList(_model.GolfHand1 !, ts.TagUsed);

            Content = mainStack;
        }