コード例 #1
0
        public RookBiddingView(RookVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

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

            SetUpMarginsOnParentControl(stack, rect);
            firstBid.LoadLists(model.Bid1 !);
            stack.Children.Add(firstBid);
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            Button button = GetGamingButton("Place Bid", nameof(RookBiddingViewModel.BidAsync));

            otherStack.Children.Add(button);
            button = GetGamingButton("Pass", nameof(RookBiddingViewModel.PassAsync));
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
コード例 #2
0
 public RookMainGameClass(IGamePackageResolver mainContainer,
                          IEventAggregator aggregator,
                          BasicData basicData,
                          TestOptions test,
                          RookVMData currentMod,
                          IMultiplayerSaveState state,
                          IAsyncDelayer delay,
                          ICardInfo <RookCardInformation> cardInfo,
                          CommandContainer command,
                          RookGameContainer gameContainer,
                          ITrickData trickData,
                          ITrickPlay trickPlay,
                          IAdvancedTrickProcesses aTrick,
                          IBidProcesses bidProcesses,
                          ITrumpProcesses trumpProcesses,
                          INestProcesses nestProcesses
                          )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay)
 {
     _model          = currentMod;
     _command        = command;
     _gameContainer  = gameContainer;
     _aTrick         = aTrick;
     _bidProcesses   = bidProcesses;
     _trumpProcesses = trumpProcesses;
     _nestProcesses  = nestProcesses;
     _gameContainer.StartNewTrickAsync = StartNewTrickAsync;
     _gameContainer.StartingStatus     = (() => this.StartingStatus());
 }
コード例 #3
0
        public RookBiddingView(RookVMData model)
        {
            NumberChooserXF firstBid = new NumberChooserXF();

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

            SetUpMarginsOnParentControl(stack);
            stack.Children.Add(firstBid);
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            stack.Children.Add(otherStack);
            Button button = GetGamingButton("Place Bid", nameof(RookBiddingViewModel.BidAsync));

            otherStack.Children.Add(button);
            button = GetGamingButton("Pass", nameof(RookBiddingViewModel.PassAsync));
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content   = grid;
            _firstBid = firstBid;
            _model    = model;
        }
コード例 #4
0
 public NestProcesses(RookVMData model,
                      RookGameContainer gameContainer
                      )
 {
     _model         = model;
     _gameContainer = gameContainer;
 }
コード例 #5
0
 public RookMainViewModel(CommandContainer commandContainer,
                          RookMainGameClass mainGame,
                          RookVMData viewModel,
                          BasicData basicData,
                          TestOptions test,
                          IGamePackageResolver resolver
                          )
     : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
 {
     _mainGame = mainGame;
     _model    = viewModel;
     _resolver = resolver;
     _model.Deck1.NeverAutoDisable = true;
     _model.Dummy1.SendEnableProcesses(this, (() =>
     {
         if (_mainGame !.SaveRoot !.GameStatus != EnumStatusList.Normal)
         {
             return(false);
         }
         if (_mainGame.PlayerList.Count() == 3)
         {
             return(false);
         }
         return(_mainGame.SaveRoot.DummyPlay);
     }));
 }
コード例 #6
0
        public static int CardToPlay(RookMainGameClass mainGame, RookVMData model)
        {
            DeckRegularDict <RookCardInformation> newList;

            if (mainGame.SaveRoot !.DummyPlay)
            {
                newList = model.Dummy1 !.HandList.Where(items => mainGame.IsValidMove(items.Deck)).ToRegularDeckDict();
            }
コード例 #7
0
 public RookColorViewModel(CommandContainer commandContainer,
                           RookVMData model,
                           ITrumpProcesses processes
                           )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _processes       = processes;
 }
コード例 #8
0
 public static async Task CardToBidAsync(RookVMData model, IBidProcesses processes)
 {
     if (await processes.CanPassAsync() == false)
     {
         model.BidChosen = model.Bid1 !.NumberToChoose();
         return;
     }
     model.BidChosen = model.Bid1 !.NumberToChoose(false);
 }
コード例 #9
0
 public RookBiddingViewModel(CommandContainer commandContainer,
                             RookVMData model,
                             IBidProcesses processes
                             )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _processes       = processes;
 }
コード例 #10
0
 public string Text => "Choose Nest Cards"; //to show same on both xamarin forms and wpf
 public RookNestViewModel(CommandContainer commandContainer,
                          RookVMData model,
                          INestProcesses processes
                          )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _processes       = processes;
 }
コード例 #11
0
        public RookColorView(RookVMData model)
        {
            EnumPickerXF <CheckerChoiceCP <EnumColorTypes>,
                          CheckerChooserXF <EnumColorTypes>, EnumColorTypes> color;

            Text = "Trump Info";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack);
            color = new EnumPickerXF <CheckerChoiceCP <EnumColorTypes>, CheckerChooserXF <EnumColorTypes>, EnumColorTypes>();
            color.LoadLists(model.Color1 !);
            stack.Children.Add(color);
            Button button = GetGamingButton("Choose Color", nameof(RookColorViewModel.TrumpAsync));

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

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
コード例 #12
0
        public static void ColorToCall(RookVMData model)
        {
            var thisColor = model.Color1 !.ItemToChoose();

            model.ColorChosen = thisColor;
        }
コード例 #13
0
        public RookMainView(IEventAggregator aggregator,
                            TestOptions test,
                            RookVMData model
                            )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>();


            _trick1 = new SeveralPlayersTrickWPF <EnumColorTypes, RookCardInformation, RookGraphicsCP, CardGraphicsWPF, RookPlayerItem>();
            _dummy1 = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>();

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

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

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

            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(RookMainViewModel.NestScreen)
            };

            mainStack.Children.Add(parent);
            _score.AddColumn("Bid Amount", true, nameof(RookPlayerItem.BidAmount));
            _score.AddColumn("Tricks Won", false, nameof(RookPlayerItem.TricksWon));
            _score.AddColumn("Current Score", false, nameof(RookPlayerItem.CurrentScore));
            _score.AddColumn("Total Score", false, nameof(RookPlayerItem.TotalScore));

            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(RookMainViewModel.NormalTurn));
            firstInfo.AddRow("Trump", nameof(RookMainViewModel.TrumpSuit));
            firstInfo.AddRow("Status", nameof(RookMainViewModel.Status));


            mainStack.Children.Add(_playerHandWPF);

            mainStack.Children.Add(_dummy1);
            otherStack.Children.Add(_score);
            otherStack.Children.Add(firstInfo.GetContent);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(RookMainViewModel.BidScreen)
            };
            otherStack.Children.Add(parent);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(RookMainViewModel.ColorScreen)
            };
            otherStack.Children.Add(parent);
            otherStack.Children.Add(_trick1);

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