public PersianSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);


            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);
            var autoBut = GetGamingButton("Auto Make Move", nameof(PersianSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(PersianSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Deal", nameof(PersianSolitaireMainViewModel.DealNumber));
            var finalButton = GetGamingButton("New Deal", nameof(PersianSolitaireMainViewModel.NewDeal));

            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            stack.Children.Add(finalButton);
            otherStack.Children.Add(stack);



            Content = otherStack; //if not doing this, rethink.
        }
Beispiel #2
0
        public BlockElevenSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);



            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            var scoresAlone = new SimpleLabelGrid();

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

            //not sure where to place.
            _waste = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();

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

            Content = otherStack;
        }
Beispiel #3
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;
        }
 private void SetUpTeamPiles()
 {
     _mainGame !.SingleInfo = _gameContainer.PlayerList !.GetSelf();
     if (_gameContainer.SingleInfo !.MainHandList.Any(items => items.CompleteCategory == EnumCompleteCategories.None))
     {
         throw new BasicBlankException("Cannot have category of none.  Rethink");
     }
     _pileStack !.Children.Clear();
     _gameContainer.TeamList.ForEach(thisTeam =>
     {
         Grid tempGrid   = new Grid();
         tempGrid.Margin = new Thickness(0, 0, 0, 20);
         AddAutoRows(tempGrid, 2);
         AddAutoColumns(tempGrid, 2);
         TextBlock ThisLabel  = new TextBlock();
         ThisLabel.Text       = thisTeam.Text;
         ThisLabel.Foreground = Brushes.Aqua;
         ThisLabel.FontWeight = FontWeights.Bold;
         AddControlToGrid(tempGrid, ThisLabel, 0, 0);
         Grid.SetColumnSpan(ThisLabel, 2);
         ThisLabel.HorizontalAlignment = HorizontalAlignment.Center; // try this
         BasicMultiplePilesWPF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsWPF> thisDis = new BasicMultiplePilesWPF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsWPF>();
         thisDis.Init(thisTeam.CardPiles, "");
         thisDis.StartAnimationListener("team" + thisTeam.TeamNumber);
         AddControlToGrid(tempGrid, thisDis, 1, 0);
         SafetiesWPF thisS = new SafetiesWPF();
         thisS.Init(thisTeam, _mainGame, _gameContainer.Command);
         _disList.Add(thisDis);
         AddControlToGrid(tempGrid, thisS, 1, 1);
         _pileStack.Children.Add(tempGrid);
     });
 }
        public SkipboMainView(IEventAggregator aggregator,
                              TestOptions test,
                              SkipboVMData model
                              )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile      = new BaseDeckWPF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsWPF>();
            _score          = new ScoreBoardWPF();
            _playerHandWPF  = new BaseHandWPF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsWPF>();
            _publicGraphics = new BasicMultiplePilesWPF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsWPF>();

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

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_publicGraphics);
            mainStack.Children.Add(otherStack);
            StackPanel tempStack = new StackPanel();
            var        thisLabel = GetDefaultLabel();

            thisLabel.Text = "Cards To Reshuffle";
            tempStack.Children.Add(thisLabel);
            otherStack.Children.Add(tempStack);
            thisLabel = GetDefaultLabel();
            thisLabel.SetBinding(TextBlock.TextProperty, nameof(SkipboMainViewModel.CardsToShuffle));
            tempStack.Children.Add(thisLabel);
            _score.AddColumn("In Stock", false, nameof(SkipboPlayerItem.InStock));
            int x;

            for (x = 1; x <= 4; x++) //has to change for flinch.
            {
                var thisStr = "Discard" + x;
                _score.AddColumn(thisStr, false, thisStr);
            }
            _score.AddColumn("Stock Left", false, nameof(SkipboPlayerItem.StockLeft));
            _score.AddColumn("Cards Left", false, nameof(SkipboPlayerItem.ObjectCount)); //very common.
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

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


            otherStack.Children.Add(_score);

            mainStack.Children.Add(_playerHandWPF);
            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(SkipboMainViewModel.PlayerPilesScreen)
            };

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

            _deckGPile.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;
        }
Beispiel #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;
        }