public SpadesBeginningView(Spades2PlayerVMData model, IEventAggregator aggregator)
        {
            StackLayout stack = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal
            };

            _deckGPile    = new BaseDeckXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _discardGPile = new BasePileXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _other        = new BasePileXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <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;
            _aggregator = aggregator;
        }
 public SpadesBiddingViewModel(CommandContainer commandContainer, Spades2PlayerVMData model, Spades2PlayerMainGameClass mainGame)
 {
     CommandContainer = commandContainer;
     _model           = model;
     _mainGame        = mainGame;
     _model.Bid1.ChangedNumberValueAsync += Bid1_ChangedNumberValueAsync;
 }
Beispiel #3
0
        public Spades2PlayerMainView(IEventAggregator aggregator,
                                     TestOptions test,
                                     Spades2PlayerVMData model
                                     )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _score         = new ScoreBoardXF();
            _trick1        = new TwoPlayerTrickXF <EnumSuitList, Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();
            _playerHandWPF = new BaseHandXF <Spades2PlayerCardInformation, ts, DeckOfCardsXF <Spades2PlayerCardInformation> >();

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

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

            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(Spades2PlayerMainViewModel.BeginningScreen));

            mainStack.Children.Add(parent);

            _score.AddColumn("Cards", false, nameof(Spades2PlayerPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Bidded", false, nameof(Spades2PlayerPlayerItem.HowManyBids));
            _score.AddColumn("Won", false, nameof(Spades2PlayerPlayerItem.TricksWon));
            _score.AddColumn("Bags", false, nameof(Spades2PlayerPlayerItem.Bags));
            _score.AddColumn("C Score", false, nameof(Spades2PlayerPlayerItem.CurrentScore));
            _score.AddColumn("T Score", false, nameof(Spades2PlayerPlayerItem.TotalScore)); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();
            firstInfo.AddRow("Turn", nameof(Spades2PlayerMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(Spades2PlayerMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(Spades2PlayerMainViewModel.RoundNumber));

            mainStack.Children.Add(_trick1);
            parent = new ParentSingleUIContainer(nameof(Spades2PlayerMainViewModel.BiddingScreen));
            mainStack.Children.Add(parent);
            mainStack.Children.Add(_playerHandWPF);
            StackLayout other = new StackLayout();

            other.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(other);
            other.Children.Add(firstInfo.GetContent);
            other.Children.Add(_score);


            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
Beispiel #4
0
        private readonly Spades2PlayerGameContainer _gameContainer; //if not needed, delete.

        public Spades2PlayerMainViewModel(CommandContainer commandContainer,
                                          Spades2PlayerMainGameClass mainGame,
                                          Spades2PlayerVMData viewModel,
                                          BasicData basicData,
                                          TestOptions test,
                                          IGamePackageResolver resolver,
                                          Spades2PlayerGameContainer gameContainer
                                          )
            : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
        {
            _mainGame      = mainGame;
            _model         = viewModel;
            _resolver      = resolver;
            _gameContainer = gameContainer;
            _model.Deck1.NeverAutoDisable = true;
            GameStatus = _model.GameStatus;
        }
 public Spades2PlayerMainGameClass(IGamePackageResolver mainContainer,
                                   IEventAggregator aggregator,
                                   BasicData basicData,
                                   TestOptions test,
                                   Spades2PlayerVMData currentMod,
                                   IMultiplayerSaveState state,
                                   IAsyncDelayer delay,
                                   ICardInfo <Spades2PlayerCardInformation> cardInfo,
                                   CommandContainer command,
                                   Spades2PlayerGameContainer gameContainer,
                                   ITrickData trickData,
                                   ITrickPlay trickPlay,
                                   IAdvancedTrickProcesses aTrick
                                   )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay)
 {
     _model         = currentMod;
     _command       = command;
     _gameContainer = gameContainer;
     _aTrick        = aTrick;
 }
Beispiel #6
0
        public SpadesBiddingView(Spades2PlayerVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

            firstBid.Columns = 7;
            Text             = "Bid Info";
            var        rect  = ThisFrame.GetControlArea();
            StackPanel stack = new StackPanel();

            SetUpMarginsOnParentControl(stack, rect);
            firstBid.Margin = new Thickness(3, 3, 3, 3);
            firstBid.LoadLists(model.Bid1 !);
            stack.Children.Add(firstBid);
            Button button = GetGamingButton("Place Bid", nameof(SpadesBiddingViewModel.BidAsync));

            stack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
        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;
        }
        public SpadesBiddingView(Spades2PlayerVMData model, IEventAggregator aggregator)
        {
            NumberChooserXF firstBid = new NumberChooserXF();

            firstBid.Columns = 7;
            //firstBid.Rows = 2;
            Text = "Bid Info";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack);
            firstBid.Margin = new Thickness(3, 3, 3, 3);
            firstBid.LoadLists(model.Bid1 !);
            stack.Children.Add(firstBid);
            Button button = GetSmallerButton("Place Bid", nameof(SpadesBiddingViewModel.BidAsync));

            button.Margin = new Thickness(3, -60, 3, 3);
            stack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content     = grid;
            _aggregator = aggregator;
        }