public MailPileView(PaydayVMData data)
        {
            BasePileWPF <MailCard, CardGraphicsCP, MailCardWPF> pile = new BasePileWPF <MailCard, CardGraphicsCP, MailCardWPF>();

            pile.Init(data.MailPile, "");
            Content = pile;
        }
        public TriangleSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile    = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _triangle     = new TriangleWPF();
            StackPanel stack = new StackPanel();

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

            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel other = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            other.Children.Add(_deckGPile);
            other.Children.Add(_discardGPile);
            other.Children.Add(_triangle);
            stack.Children.Add(other);
            Content = stack; //if not doing this, rethink.
        }
示例#3
0
        public FaceoffView(BladesOfSteelVMData model, IEventAggregator aggregator)
        {
            aggregator.Subscribe(this);
            _yourFace     = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _opponentFace = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();

            StackPanel stack = new StackPanel();

            _deck       = new BaseDeckWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _model      = model;
            _aggregator = aggregator;
            _deck.HorizontalAlignment = HorizontalAlignment.Left;
            _deck.VerticalAlignment   = VerticalAlignment.Top;
            stack.Children.Add(_deck);
            SimpleLabelGrid firsts = new SimpleLabelGrid();

            firsts.AddRow("Instructions", nameof(FaceoffViewModel.Instructions));
            stack.Children.Add(firsts.GetContent);

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

            stack.Children.Add(other);
            other.Children.Add(_yourFace);
            other.Children.Add(_opponentFace);
            _yourFace.HorizontalAlignment     = HorizontalAlignment.Left;
            _yourFace.VerticalAlignment       = VerticalAlignment.Top;
            _opponentFace.HorizontalAlignment = HorizontalAlignment.Left;
            _yourFace.VerticalAlignment       = VerticalAlignment.Top;
            _yourFace.Margin     = new Thickness(5);
            _opponentFace.Margin = new Thickness(5);
            Content = stack;
        }
示例#4
0
        public OldMaidMainView(IEventAggregator aggregator,
                               TestOptions test,
                               OldMaidVMData model
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _discardGPile          = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _playerHandWPF         = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _playerHandWPF.Divider = 2;

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

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(OldMaidMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(OldMaidMainViewModel.Status));
            var endButton = GetGamingButton("End Turn", nameof(OldMaidMainViewModel.EndTurnAsync));

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            otherStack.Children.Add(endButton);


            ParentSingleUIContainer opponent = new ParentSingleUIContainer()
            {
                Name = nameof(OldMaidMainViewModel.OpponentScreen)
            };

            mainStack.Children.Add(opponent);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(firstInfo.GetContent);


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


            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
示例#5
0
        public KlondikeSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut = GetGamingButton("Auto Make Move", nameof(KlondikeSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

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

            //not sure where to place.
            _waste = new SolitairePilesWPF();
            //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.
            var miscDiscard = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();

            //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);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            otherStack.Children.Add(_main);
            stack.Children.Add(otherStack);
            stack.Children.Add(_waste);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            grid.Children.Add(stack);
            stack = new StackPanel();
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            AddControlToGrid(grid, stack, 0, 1);
            Content = grid;
        }
        public CribbagePatienceMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile = new BaseDeckWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();

            StackPanel stack = new StackPanel();

            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;
            _hand1Score = new ScoreHandCribUI();
            _hand2Score = new ScoreHandCribUI();
            _cribScore  = new ScoreHandCribUI();
            _score1     = new ScoreSummaryUI();
            _yourHand   = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _cribHand   = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            SetMargins(_score1);
            SetMargins(_hand1Score);
            SetMargins(_hand2Score);
            SetMargins(_cribScore);
            SetMargins(_cribHand);
            SetMargins(_yourHand); //i think should be this too.
            Grid grid = new Grid();

            AddLeftOverRow(grid, 40);
            AddLeftOverRow(grid, 60);
            AddAutoRows(grid, 1);
            AddAutoColumns(grid, 1);
            AddLeftOverColumn(grid, 40);
            AddLeftOverColumn(grid, 40);
            AddControlToGrid(grid, stack, 2, 0);
            Grid.SetColumnSpan(stack, 3);
            stack.Orientation = Orientation.Horizontal;
            var cributton      = GetGamingButton("To Crib", nameof(CribbagePatienceMainViewModel.CribAsync));
            var continueButton = GetGamingButton("Continue", nameof(CribbagePatienceMainViewModel.Continue));

            stack.Children.Add(cributton);
            stack.Children.Add(continueButton);
            StackPanel otherStack = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            stack = new StackPanel();
            otherStack.Children.Add(_deckGPile);
            _startCard = new BasePileWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            otherStack.Children.Add(_startCard);
            stack.Children.Add(otherStack);
            stack.Children.Add(_yourHand);
            AddControlToGrid(grid, stack, 1, 0);
            AddControlToGrid(grid, _cribHand, 0, 0);
            AddControlToGrid(grid, _score1, 0, 2);
            _grid = grid;

            Content = grid;
        }
示例#7
0
        public VegasSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(VegasSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGrid();
            var thisCon     = new CurrencyConverter();

            scoresAlone.AddRow("Money", nameof(VegasSolitaireMainViewModel.Money), thisCon);
            var tempGrid = scoresAlone.GetContent;

            _waste = new SolitairePilesWPF();

            otherStack.Children.Add(_main);
            stack.Children.Add(otherStack);
            stack.Children.Add(_waste);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            AddControlToGrid(grid, stack, 0, 0);

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

            stack        = new StackPanel();
            stack.Margin = new Thickness(20, 5, 5, 5);
            AddControlToGrid(grid, stack, 0, 1);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);

            Content = grid; //if not doing this, rethink.
        }
示例#8
0
        private readonly MainUI _main; //if something change here.
        public CaptiveQueensSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            _main        = new MainUI();
            _main.Margin = new Thickness(10, 5, 5, 5);
            stack.Children.Add(otherStack);
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            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;

            stack.Children.Add(tempGrid);
            //not sure where to place.
            //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);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

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

            Content = finalStack;
            finalStack.Children.Add(stack);
            finalStack.Children.Add(_main);
        }
        public AlternationSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(100, 5, 5, 5);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(AlternationSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

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

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

            StackPanel tempStack = new StackPanel();

            otherStack.Children.Add(tempStack);
            tempStack.Children.Add(tempGrid);
            tempStack.Children.Add(autoBut);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);


            Content = stack; //if not doing this, rethink.
        }
示例#10
0
        public DemonSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(DemonSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Starting Number", nameof(DemonSolitaireMainViewModel.StartingNumber));
            var tempGrid = scoresAlone.GetContent;

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

            _heel.HorizontalAlignment = HorizontalAlignment.Left;
            _heel.VerticalAlignment   = VerticalAlignment.Top;
            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;
        }
        public CarpetSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            stack.Children.Add(otherStack);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut = GetGamingButton("Auto Make Move", nameof(CarpetSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

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

            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            AddControlToGrid(grid, stack, 0, 0);
            stack = new StackPanel();
            stack.Children.Add(_main);
            stack.Children.Add(_discard);
            AddControlToGrid(grid, stack, 0, 1);
            Content = grid;
        }
示例#12
0
        public EasyGoSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(EasyGoSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGrid();

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

            _waste = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();

            StackPanel tempStack = new StackPanel();

            tempStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(_main);
            stack.Children.Add(_waste);
            tempStack.Children.Add(stack);
            stack        = new StackPanel();
            stack.Margin = new Thickness(30, 30, 0, 0);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            stack.Children.Add(otherStack);
            tempStack.Children.Add(stack);
            Content = tempStack;
        }
示例#13
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.
        }
        public SpadesBeginningView(Spades2PlayerVMData model)
        {
            StackPanel stack = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            _deckGPile    = new BaseDeckWPF <Spades2PlayerCardInformation, ts, DeckOfCardsWPF <Spades2PlayerCardInformation> >();
            _discardGPile = new BasePileWPF <Spades2PlayerCardInformation, ts, DeckOfCardsWPF <Spades2PlayerCardInformation> >();
            _other        = new BasePileWPF <Spades2PlayerCardInformation, ts, DeckOfCardsWPF <Spades2PlayerCardInformation> >();
            stack.Children.Add(_deckGPile);
            stack.Children.Add(_discardGPile);
            var button = GetGamingButton("Take Card", nameof(SpadesBeginningViewModel.TakeCardAsync));

            stack.Children.Add(button);
            stack.Children.Add(_other);
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

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

            Content = stack;
            _model  = model;
        }
示例#15
0
        public CousinRummyMainView(IEventAggregator aggregator,
                                   TestOptions test,
                                   CousinRummyVMData model
                                   )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _discardGPile  = new BasePileWPF <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>, PhaseSet, SavedSet>();


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

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

            Grid buyGrid = new Grid();

            AddAutoColumns(buyGrid, 2);
            AddAutoRows(buyGrid, 2);
            Button button;

            button = GetGamingButton("Pass", nameof(CousinRummyMainViewModel.PassAsync));
            AddControlToGrid(buyGrid, button, 0, 0);
            button = GetGamingButton("Buy", nameof(CousinRummyMainViewModel.BuyAsync));
            AddControlToGrid(buyGrid, button, 0, 1);
            Grid gameGrid = new Grid();

            AddLeftOverColumn(gameGrid, 1); // try that
            AddAutoColumns(gameGrid, 1);
            AddAutoRows(gameGrid, 1);
            AddPixelRow(gameGrid, 450);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;
            AddControlToGrid(buyGrid, _deckGPile, 1, 0);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            AddControlToGrid(buyGrid, _discardGPile, 1, 1);
            StackPanel otherStack = new StackPanel();

            otherStack.Children.Add(_playerHandWPF);
            button = GetGamingButton("Lay Down Initial Sets", nameof(CousinRummyMainViewModel.FirstSetsAsync));
            otherStack.Children.Add(button);
            button = GetGamingButton("Lay Down Other Sets", nameof(CousinRummyMainViewModel.OtherSetsAsync)); // i think its othersets commands (?)
            otherStack.Children.Add(button);
            AddControlToGrid(gameGrid, otherStack, 0, 0);
            _tempG.Height = 400;
            AddControlToGrid(gameGrid, _tempG, 0, 1);
            AddControlToGrid(gameGrid, _mainG, 1, 0);
            Grid.SetColumnSpan(_mainG, 2);
            _score.AddColumn("Cards Left", false, nameof(CousinRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Tokens Left", false, nameof(CousinRummyPlayerItem.TokensLeft));
            _score.AddColumn("Current Score", false, nameof(CousinRummyPlayerItem.CurrentScore), rightMargin: 5);
            _score.AddColumn("Total Score", false, nameof(CousinRummyPlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Normal Turn", nameof(CousinRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(CousinRummyMainViewModel.Status));
            firstInfo.AddRow("Other Turn", nameof(CousinRummyMainViewModel.OtherLabel));
            firstInfo.AddRow("Phase", nameof(CousinRummyMainViewModel.PhaseData));
            var tempStack = new StackPanel();

            tempStack.Orientation = Orientation.Horizontal;
            tempStack.Children.Add(_score);
            tempStack.Children.Add(buyGrid);
            tempStack.Children.Add(firstInfo.GetContent);
            otherStack.Children.Add(tempStack);
            mainStack.Children.Add(gameGrid);



            _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;
        }
示例#16
0
        public BladesOfSteelMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     BladesOfSteelVMData model,
                                     BladesOfSteelGameContainer 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();
            _playerHandWPF = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();

            _mainDefenseCards = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _opponentDefense  = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _opponentAttack   = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _yourDefense      = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            _yourAttack       = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >();
            ScoringGuideWPF tempScore = new ScoringGuideWPF();

            _score.AddColumn("Cards Left", true, nameof(BladesOfSteelPlayerItem.ObjectCount), rightMargin: 5);
            _score.AddColumn("Score", true, nameof(BladesOfSteelPlayerItem.Score), rightMargin: 5);



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

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;

            otherStack.Children.Add(tempScore);
            otherStack.Children.Add(_score);
            mainStack.Children.Add(otherStack);

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

            StackPanel firstStack = new StackPanel();

            AddVerticalLabelGroup("Instructions", nameof(BladesOfSteelMainViewModel.Instructions), firstStack);
            otherStack.Children.Add(firstStack);
            Grid playerArea = new Grid();

            AddAutoColumns(playerArea, 3);
            AddAutoRows(playerArea, 2);
            _opponentDefense.Margin = new Thickness(0, 0, 0, 20);
            AddControlToGrid(playerArea, _opponentDefense, 0, 2);
            AddControlToGrid(playerArea, _opponentAttack, 0, 1);
            _opponentAttack.Margin = new Thickness(0, 0, 0, 20);
            AddControlToGrid(playerArea, _mainDefenseCards, 1, 0);
            AddControlToGrid(playerArea, _yourAttack, 1, 1);
            AddControlToGrid(playerArea, _yourDefense, 1, 2);
            mainStack.Children.Add(playerArea);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            AddControlToGrid(playerArea, otherStack, 0, 0);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            var endButton = GetGamingButton("End Turn", nameof(BladesOfSteelMainViewModel.EndTurnAsync));

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            endButton.VerticalAlignment   = VerticalAlignment.Center;
            otherStack.Children.Add(endButton);
            var otherBut = GetGamingButton("Pass", nameof(BladesOfSteelMainViewModel.PassAsync));

            otherStack.Children.Add(otherBut);
            otherBut.HorizontalAlignment = HorizontalAlignment.Left;
            otherBut.VerticalAlignment   = VerticalAlignment.Center;
            otherStack.Children.Add(_playerHandWPF);
            _deckGPile.Margin                 = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin              = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment    = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment      = VerticalAlignment.Top;
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            _score !.LoadLists(gameContainer.PlayerList !);
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think
            _discardGPile !.Init(_model.Pile1 !, ts.TagUsed);            // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile();                   // its the main one.

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


            _mainDefenseCards !.LoadList(_model.MainDefense1 !, ts.TagUsed);
            _yourAttack !.LoadList(_model.YourAttackPile !, ts.TagUsed);
            _yourDefense !.LoadList(_model.YourDefensePile !, ts.TagUsed);
            _opponentAttack !.LoadList(_model.OpponentAttackPile !, ts.TagUsed);
            _opponentDefense !.LoadList(_model.OpponentDefensePile !, ts.TagUsed);

            Content = mainStack;
        }
        public FillOrBustMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  FillOrBustVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckWPF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsWPF>();
            _discardGPile = new BasePileWPF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsWPF>();
            _score        = new ScoreBoardWPF();
            _diceControl  = new DiceListControlWPF <SimpleDice>();
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(FillOrBustMainViewModel.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.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Current Score", true, nameof(FillOrBustPlayerItem.CurrentScore), rightMargin: 10);
            _score.AddColumn("Total Score", true, nameof(FillOrBustPlayerItem.TotalScore), rightMargin: 10);
            otherStack.Children.Add(_score);
            mainStack.Children.Add(_diceControl);

            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            var button = GetGamingButton("Roll Dice", nameof(FillOrBustMainViewModel.RollDiceAsync));

            button.Margin = new Thickness(0, 0, 5, 0);
            otherStack.Children.Add(button);
            button        = GetGamingButton("Remove Dice", nameof(FillOrBustMainViewModel.ChooseDiceAsync));
            button.Margin = new Thickness(0, 0, 5, 0);
            otherStack.Children.Add(button);
            var endButton = GetGamingButton("End Turn", nameof(FillOrBustMainViewModel.EndTurnAsync));

            otherStack.Children.Add(endButton);
            SimpleLabelGrid tempInfo = new SimpleLabelGrid();

            tempInfo.AddRow("Temporary Score", nameof(FillOrBustMainViewModel.TempScore));
            tempInfo.AddRow("Score", nameof(FillOrBustMainViewModel.DiceScore));
            otherStack.Children.Add(tempInfo.GetContent);

            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

            mainStack.Children.Add(firstInfo.GetContent);


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

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


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

            _deckGPile     = new BaseDeckWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _discardGPile  = new BasePileWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _crib1         = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _main1         = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >();
            _otherScore    = new ScoreUI();
            _main1.Divider = 1.5;


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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(CribbageMainViewModel.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.
            otherStack.Children.Add(_main1);
            mainStack.Children.Add(otherStack);



            _score.AddColumn("Cards Left", false, nameof(CribbagePlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Is Skunk Hole", false, nameof(CribbagePlayerItem.IsSkunk), useTrueFalse: true);
            _score.AddColumn("First Position", false, nameof(CribbagePlayerItem.FirstPosition));
            _score.AddColumn("Second Position", false, nameof(CribbagePlayerItem.SecondPosition));
            _score.AddColumn("Score Round", false, nameof(CribbagePlayerItem.ScoreRound));
            _score.AddColumn("Total Score", false, nameof(CribbagePlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(CribbageMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(CribbageMainViewModel.Status));
            firstInfo.AddRow("Dealer", nameof(CribbageMainViewModel.Dealer));
            SimpleLabelGrid others = new SimpleLabelGrid();

            others.AddRow("Count", nameof(CribbageMainViewModel.TotalCount));
            mainStack.Children.Add(_playerHandWPF);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);

            var button = GetGamingButton("Continue", nameof(CribbageMainViewModel.ContinueAsync));

            otherStack.Children.Add(button);
            button = GetGamingButton("To Crib", nameof(CribbageMainViewModel.CribAsync));
            otherStack.Children.Add(button);
            button = GetGamingButton("Play", nameof(CribbageMainViewModel.PlayAsync));
            otherStack.Children.Add(button);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(firstInfo.GetContent);
            otherStack.Children.Add(_crib1);
            Grid finalGrid = new Grid();

            AddPixelRow(finalGrid, 300); // hopefully this is enough
            AddLeftOverRow(finalGrid, 1);
            AddLeftOverColumn(finalGrid, 70);
            AddLeftOverColumn(finalGrid, 30);
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            Grid.SetRowSpan(mainStack, 2);
            StackPanel finalStack = new StackPanel();

            finalStack.Children.Add(others.GetContent);
            finalStack.Children.Add(_otherScore);
            AddControlToGrid(finalGrid, finalStack, 0, 1);
            AddControlToGrid(finalGrid, _score, 1, 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.
            }
            Content = finalGrid;
        }
示例#19
0
        public FiveCrownsMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  FiveCrownsVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>();
            _discardGPile  = new BasePileWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>();
            _tempG         = new TempRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>();
            _mainG         = new MainRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF, PhaseSet, SavedSet>();

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

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


            Grid finalGrid = new Grid();

            AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard.
            AddLeftOverRow(finalGrid, 80);
            mainStack.Children.Add(finalGrid);
            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 40); // 50 was too much.  if there is scrolling, i guess okay.
            AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary)
            AddAutoColumns(firstGrid, 1);     // maybe 1 (well see)
            AddLeftOverColumn(firstGrid, 15); // for other details
            AddLeftOverColumn(firstGrid, 30); // for scoreboard
            _deckGPile.HorizontalAlignment    = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment      = VerticalAlignment.Top;
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);            // can reposition or not even have as well.
            AddControlToGrid(firstGrid, otherStack, 0, 2);     // i think
            AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think
            var        thisBut   = GetGamingButton("Lay" + Constants.vbCrLf + "Down", nameof(FiveCrownsMainViewModel.LayDownSetsAsync));
            StackPanel tempStack = new StackPanel();

            tempStack.Orientation = Orientation.Horizontal;
            tempStack.Children.Add(thisBut);
            thisBut           = GetGamingButton("Back", nameof(FiveCrownsMainViewModel.Back));
            thisBut.FontSize -= 4;
            tempStack.Children.Add(thisBut);
            AddControlToGrid(firstGrid, tempStack, 0, 1);
            _score.AddColumn("Cards Left", true, nameof(FiveCrownsPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Current Score", true, nameof(FiveCrownsPlayerItem.CurrentScore));
            _score.AddColumn("Total Score", true, nameof(FiveCrownsPlayerItem.TotalScore));
            AddControlToGrid(firstGrid, _score, 0, 4);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(FiveCrownsMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(FiveCrownsMainViewModel.Status));
            firstInfo.AddRow("Up To", nameof(FiveCrownsMainViewModel.UpTo));
            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3);
            AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think
            _tempG.Height = 700;
            StackPanel thirdStack = new StackPanel();

            thirdStack.Orientation = Orientation.Horizontal;
            thirdStack.Children.Add(_tempG);
            _mainG.Height = 700;                           // try this way.
            thirdStack.Children.Add(_mainG);
            AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think


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

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


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

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

            _trick1 = new TwoPlayerTrickWPF <EnumSuitList, RoundsCardGameCardInformation, ts, DeckOfCardsWPF <RoundsCardGameCardInformation> >();


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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(RoundsCardGameMainViewModel.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.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("# In Hand", true, nameof(RoundsCardGamePlayerItem.ObjectCount));
            _score.AddColumn("Tricks Won", true, nameof(RoundsCardGamePlayerItem.TricksWon));
            _score.AddColumn("Rounds Won", true, nameof(RoundsCardGamePlayerItem.RoundsWon));
            _score.AddColumn("Points", true, nameof(RoundsCardGamePlayerItem.CurrentPoints));
            _score.AddColumn("Total Score", true, nameof(RoundsCardGamePlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(RoundsCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Trump", nameof(RoundsCardGameMainViewModel.TrumpSuit));
            firstInfo.AddRow("Status", nameof(RoundsCardGameMainViewModel.Status));
            mainStack.Children.Add(_trick1);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            mainStack.Children.Add(_score);


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

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


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

            _deckGPile     = new BaseDeckWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>();
            _discardGPile  = new BasePileWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>();
            _roundControl  = new RoundUI();

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

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

            AddLeftOverColumn(grid2, 60);
            AddLeftOverColumn(grid2, 40); // can adjust as needed
            AddControlToGrid(grid2, mainStack, 0, 0);
            _roundControl = new RoundUI();
            AddControlToGrid(grid2, _roundControl, 0, 1);
            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 thisBut = GetGamingButton("Go Out", nameof(A8RoundRummyMainViewModel.GoOutAsync));

            otherStack.Children.Add(thisBut);
            mainStack.Children.Add(_playerHandWPF);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(A8RoundRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(A8RoundRummyMainViewModel.Status));
            firstInfo.AddRow("Next", nameof(A8RoundRummyMainViewModel.NextTurn));
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(A8RoundRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Score", true, nameof(A8RoundRummyPlayerItem.TotalScore));
            mainStack.Children.Add(_score);

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

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


            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = grid2;
        }
示例#22
0
        public FourSuitRummyMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     FourSuitRummyVMData model
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _discardGPile  = new BasePileWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            _tempG         = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >();
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

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

            Grid finalGrid = new Grid();

            AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard.
            AddLeftOverRow(finalGrid, 80);
            mainStack.Children.Add(finalGrid);



            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 60); // 50 was too much.  if there is scrolling, i guess okay.
            AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary)
            AddAutoColumns(firstGrid, 1);     // maybe 1 (well see)
            AddLeftOverColumn(firstGrid, 15); // for other details
            AddLeftOverColumn(firstGrid, 30); // for scoreboard
            _deckGPile.HorizontalAlignment    = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment      = VerticalAlignment.Top;
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            AddControlToGrid(firstGrid, otherStack, 0, 2);     // i think
            AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think
            var thisBut = GetGamingButton("Play Sets", nameof(FourSuitRummyMainViewModel.PlaySetsAsync));

            AddControlToGrid(firstGrid, thisBut, 0, 1);
            _score.AddColumn("Cards Left", true, nameof(FourSuitRummyPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Score", true, nameof(FourSuitRummyPlayerItem.TotalScore));
            AddControlToGrid(firstGrid, _score, 0, 4);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(FourSuitRummyMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(FourSuitRummyMainViewModel.Status));
            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3);
            AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think
            _tempG.Height = 700;
            StackPanel thirdStack = new StackPanel();

            thirdStack.Orientation = Orientation.Horizontal;
            thirdStack.Children.Add(_tempG);
            Grid setGrid = new Grid();

            AddLeftOverColumn(setGrid, 50);
            AddLeftOverColumn(setGrid, 50);
            AddPixelRow(setGrid, 700); // i think this one needs that.
            thirdStack.Children.Add(setGrid);

            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(FourSuitRummyMainViewModel.YourSetsScreen)
            };

            AddControlToGrid(setGrid, parent, 0, 0);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(FourSuitRummyMainViewModel.OpponentSetsScreen)
            };
            AddControlToGrid(setGrid, parent, 0, 1);

            AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think


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

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


            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public MonasteryCardGameMainView(IEventAggregator aggregator,
                                         TestOptions test,
                                         MonasteryCardGameVMData model
                                         )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

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

            _tempG      = new TempRummySetsWPF <EnumSuitList, EnumColorList, MonasteryCardInfo, ts, DeckOfCardsWPF <MonasteryCardInfo> >();
            _mainG      = new MainRummySetsWPF <EnumSuitList, EnumColorList, MonasteryCardInfo, ts, DeckOfCardsWPF <MonasteryCardInfo>, RummySet, SavedSet>();
            _missionWPF = new MissionUI();


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

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

            AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard.
            AddLeftOverRow(finalGrid, 80);
            mainStack.Children.Add(finalGrid);
            Grid firstGrid = new Grid();

            AddLeftOverColumn(firstGrid, 40); // 50 was too much.  if there is scrolling, i guess okay.
            AddAutoColumns(firstGrid, 1);     // maybe 1 (well see)
            AddLeftOverColumn(firstGrid, 15); // for other details
            AddLeftOverColumn(firstGrid, 30); // for scoreboard
            _deckGPile.HorizontalAlignment    = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment      = VerticalAlignment.Top;
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            AddControlToGrid(firstGrid, otherStack, 0, 1);
            AddControlToGrid(firstGrid, _playerHandWPF, 0, 0);
            _score.UseAbbreviationForTrueFalse = true;
            _score.AddColumn("Cards Left", false, nameof(MonasteryCardGamePlayerItem.ObjectCount));
            _score.AddColumn("Finished Mission", false, nameof(MonasteryCardGamePlayerItem.FinishedCurrentMission), useTrueFalse: true);
            int x;

            for (x = 1; x <= 9; x++)
            {
                _score.AddColumn("Mission" + x, false, "Mission" + x + "Completed", useTrueFalse: true);
            }
            AddControlToGrid(firstGrid, _score, 0, 3); // use 3 instead of 4 here.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(MonasteryCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(MonasteryCardGameMainViewModel.Status));
            AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 2);
            AddControlToGrid(finalGrid, firstGrid, 0, 0);
            _tempG.Height = 700;
            _mainG.Height = 700; //i think.
            Grid bottomGrid = new Grid();

            AddAutoColumns(bottomGrid, 1);
            AddLeftOverColumn(bottomGrid, 40);
            AddLeftOverColumn(bottomGrid, 60); // most important is the last one.  can adjust as needed though.   especially on tablets
            AddControlToGrid(bottomGrid, _tempG, 0, 0);
            AddControlToGrid(bottomGrid, _mainG, 0, 1);
            AddControlToGrid(bottomGrid, _missionWPF, 0, 2);
            AddControlToGrid(finalGrid, bottomGrid, 1, 0);

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

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


            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public SixtySix2PlayerMainView(IEventAggregator aggregator,
                                       TestOptions test,
                                       SixtySix2PlayerVMData model,
                                       IGamePackageResolver resolver
                                       )
        {
            _aggregator = aggregator;
            _model      = model;
            _resolver   = resolver;
            _aggregator.Subscribe(this);

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

            _trick1    = new TwoPlayerTrickWPF <EnumSuitList, SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >();
            _deckStack = new StackPanel();
            _marriage1 = new BaseHandWPF <SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >();
            _guide1    = new GuideUI();


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

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckStack);
            _deckStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(SixtySix2PlayerPlayerItem.ObjectCount));
            _score.AddColumn("Tricks Won", true, nameof(SixtySix2PlayerPlayerItem.TricksWon));
            _score.AddColumn("Score Round", true, nameof(SixtySix2PlayerPlayerItem.ScoreRound));
            _score.AddColumn("Game Points Round", true, nameof(SixtySix2PlayerPlayerItem.GamePointsRound));
            _score.AddColumn("Total Points Game", true, nameof(SixtySix2PlayerPlayerItem.GamePointsGame));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(SixtySix2PlayerMainViewModel.NormalTurn));
            firstInfo.AddRow("Trump", nameof(SixtySix2PlayerMainViewModel.TrumpSuit));
            firstInfo.AddRow("Status", nameof(SixtySix2PlayerMainViewModel.Status));
            firstInfo.AddRow("Bonus", nameof(SixtySix2PlayerMainViewModel.BonusPoints));
            otherStack.Children.Add(_trick1);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);

            mainStack.Children.Add(_score);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            var thisBut = GetGamingButton("Go Out", nameof(SixtySix2PlayerMainViewModel.GoOutAsync));

            otherStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Announce Marriage", nameof(SixtySix2PlayerMainViewModel.AnnouceMarriageAsync));
            otherStack.Children.Add(thisBut);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(_marriage1);
            Grid finalGrid = new Grid();

            AddLeftOverColumn(finalGrid, 60);
            AddLeftOverColumn(finalGrid, 40); // hopefully that works.
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            AddControlToGrid(finalGrid, _guide1, 0, 1);

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

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


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

            _deckGPile              = new BaseDeckWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>();
            _discardGPile           = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>();
            _score                  = new ScoreBoardWPF();
            _playerHandWPF          = new BaseHandWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>();
            _storyStack.Orientation = Orientation.Horizontal;
            _currentCard            = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>();


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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(LifeCardGameMainViewModel.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.
            otherStack.Children.Add(_currentCard);
            mainStack.Children.Add(otherStack);

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

            Button button;

            button = GetGamingButton("Years Passed", nameof(LifeCardGameMainViewModel.YearsPassedAsync));
            otherStack.Children.Add(button);
            button = GetGamingButton("Play Card", nameof(LifeCardGameMainViewModel.PlayCardAsync));
            otherStack.Children.Add(button);
            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(LifeCardGameMainViewModel.OtherScreen),
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top
            };

            otherStack.Children.Add(parent);



            _score.AddColumn("Cards Left", true, nameof(LifeCardGamePlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Points", true, nameof(LifeCardGamePlayerItem.Points));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

            mainStack.Children.Add(_playerHandWPF);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(otherStack);
            StackPanel finalStack = new StackPanel();

            finalStack.Orientation = Orientation.Horizontal;
            finalStack.Children.Add(mainStack);
            finalStack.Children.Add(_storyStack);

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

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

            _currentCard.Margin = new Thickness(5, 5, 5, 5);
            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = finalStack;
        }
示例#26
0
        public DutchBlitzMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  DutchBlitzVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile      = new BaseDeckWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>();
            _discardGPile   = new BasePileWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>();
            _score          = new ScoreBoardWPF();
            _public1.Width  = 700;
            _public1.Height = 500;
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_public1);
            otherStack.Children.Add(_score);
            _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft));
            _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound));
            _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame));
            mainStack.Children.Add(otherStack);



            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("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync));

            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);



            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status));
            firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage));
            otherStack.Children.Add(firstInfo.GetContent);


            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;

            otherStack.Children.Add(_yourDiscard);
            otherStack.Children.Add(_yourStock);
            mainStack.Children.Add(otherStack);
            _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;
        }
        private readonly RackoUI _handWPF; //use this instead.

        public RackoMainView(IEventAggregator aggregator,
                             TestOptions test,
                             RackoVMData model,
                             RackoGameContainer gameContainer
                             )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckWPF <RackoCardInformation, RackoGraphicsCP, CardGraphicsWPF>();
            _discardGPile = new BasePileWPF <RackoCardInformation, RackoGraphicsCP, CardGraphicsWPF>();
            _score        = new ScoreBoardWPF();

            _currentWPF = new BasePileWPF <RackoCardInformation, RackoGraphicsCP, CardGraphicsWPF>();
            _handWPF    = new RackoUI();

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

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

            AddAutoRows(finalGrid, 1);
            AddAutoColumns(finalGrid, 2);
            mainStack.Children.Add(_deckGPile);
            mainStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(_currentWPF);
            var thisBut = GetGamingButton("Discard Current Card", nameof(RackoMainViewModel.DiscardCurrentAsync));

            mainStack.Children.Add(thisBut);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(RackoMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(RackoMainViewModel.Status));
            mainStack.Children.Add(firstInfo.GetContent);
            thisBut = GetGamingButton("Racko", nameof(RackoMainViewModel.RackoAsync));
            mainStack.Children.Add(thisBut);
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            _score.AddColumn("Score Round", true, nameof(RackoPlayerItem.ScoreRound));
            _score.AddColumn("Score Game", true, nameof(RackoPlayerItem.TotalScore));
            int x;

            for (x = 1; x <= 10; x++)
            {
                _score.AddColumn("Section" + x, false, "Value" + x, nameof(RackoPlayerItem.CanShowValues));// 2 bindings.
            }
            mainStack.Children.Add(_score);
            _handWPF = new RackoUI();
            AddControlToGrid(finalGrid, _handWPF, 0, 1); // first column

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

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


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

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

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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(CrazyEightsMainViewModel.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.
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", false, nameof(CrazyEightsPlayerItem.ObjectCount)); //very common.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

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

            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(_score);

            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(CrazyEightsMainViewModel.SuitScreen)
            };

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

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


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

            Content = mainStack;
        }
示例#29
0
        public YahtzeeHandsDownMainView(IEventAggregator aggregator,
                                        TestOptions test,
                                        YahtzeeHandsDownVMData model
                                        )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>();
            _discardGPile  = new BasePileWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>();
            _combo1        = new ComboHandWPF();
            _chance1       = new ChanceSinglePileWPF();

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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(YahtzeeHandsDownMainViewModel.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.

            _chance1.Margin = new Thickness(5, 5, 5, 5);
            _chance1.HorizontalAlignment = HorizontalAlignment.Left;
            _chance1.VerticalAlignment   = VerticalAlignment.Top;
            otherStack.Children.Add(_chance1);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(YahtzeeHandsDownPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Total Score", true, nameof(YahtzeeHandsDownPlayerItem.TotalScore));
            _score.AddColumn("Won Last Round", true, nameof(YahtzeeHandsDownPlayerItem.WonLastRound));
            _score.AddColumn("Score Round", true, nameof(YahtzeeHandsDownPlayerItem.ScoreRound));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(YahtzeeHandsDownMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(YahtzeeHandsDownMainViewModel.Status));
            mainStack.Children.Add(_playerHandWPF);
            var otherButton = GetGamingButton("Go Out", nameof(YahtzeeHandsDownMainViewModel.GoOutAsync));

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

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            mainStack.Children.Add(endButton);
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_score);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(mainStack);
            _combo1.HandType = HandObservable <ComboCardInfo> .EnumHandList.Vertical;
            otherStack.Children.Add(_combo1);

            _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 = otherStack;
        }
示例#30
0
        public MilkRunMainView(IEventAggregator aggregator,
                               TestOptions test,
                               MilkRunVMData model,
                               MilkRunGameContainer gameContainer
                               )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();
            _discardGPile  = new BasePileWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();
            _playerHandWPF = new BaseHandWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();

            _opponentChocolateDeliveries  = new TextBlock();
            _opponentStrawberryDeliveries = new TextBlock();
            _opponentChocolatePiles       = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();
            _opponentStrawberryPiles      = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();
            _yourChocolateDeliveries      = new TextBlock();
            _yourStrawberryDeliveries     = new TextBlock();
            _yourChocolatePiles           = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();
            _yourStrawberryPiles          = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>();


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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(MilkRunMainViewModel.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.
            AddPlayArea(otherStack);
            mainStack.Children.Add(otherStack);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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

            StackPanel newStack = new StackPanel();

            mainStack.Children.Add(newStack);
            newStack.HorizontalAlignment = HorizontalAlignment.Center;
            newStack.Margin = new Thickness(0, 10, 0, 0);
            newStack.Children.Add(_playerHandWPF);
            newStack.Children.Add(firstInfo.GetContent);


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

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


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