public XactikaMainGameClass(IGamePackageResolver mainContainer,
                             IEventAggregator aggregator,
                             BasicData basicData,
                             TestOptions test,
                             XactikaVMData currentMod,
                             IMultiplayerSaveState state,
                             IAsyncDelayer delay,
                             ICardInfo <XactikaCardInformation> cardInfo,
                             CommandContainer command,
                             XactikaGameContainer gameContainer,
                             ITrickData trickData,
                             ITrickPlay trickPlay,
                             IAdvancedTrickProcesses aTrick,
                             IBidProcesses bidProcesses,
                             IShapeProcesses shapeProcesses,
                             IModeProcesses modeProcesses
                             )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay)
 {
     _model          = currentMod;
     _command        = command;
     _gameContainer  = gameContainer;
     _aTrick         = aTrick;
     _bidProcesses   = bidProcesses;
     _shapeProcesses = shapeProcesses;
     _modeProcesses  = modeProcesses;
     _gameContainer.StartNewTrickAsync    = StartNewTrickAsync;
     _gameContainer.ShowHumanCanPlayAsync = ShowHumanCanPlayAsync;
     _gameContainer.ShowTurn = (() => this.ShowTurn());
 }
        public XactikaModeView(IEventAggregator aggregator, XactikaVMData model)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackLayout   stack = new StackLayout();
            ListChooserXF list  = new ListChooserXF();



            Button button = GetGamingButton("Submit Game Option", nameof(XactikaModeViewModel.ModeAsync));

            if (ScreenUsed == EnumScreen.LargeTablet)
            {
                list.ItemHeight = 130;
                list.ItemWidth  = 500;
                button.FontSize = 125;
            }
            else
            {
                list.ItemHeight = 80;
                list.ItemWidth  = 300;
                button.FontSize = 100;
            }

            stack.Children.Add(list);
            stack.Children.Add(button);
            Content = stack;
            list.LoadLists(model.ModeChoose1);
        }
 public XactikaSubmitShapeViewModel(CommandContainer commandContainer,
                                    XactikaVMData model,
                                    IShapeProcesses processes,
                                    XactikaGameContainer gameContainer
                                    ) : base(commandContainer)
 {
     _model         = model;
     _processes     = processes;
     _gameContainer = gameContainer;
 }
示例#4
0
 public XactikaBidViewModel(CommandContainer commandContainer,
                            XactikaVMData model,
                            XactikaGameContainer gameContainer,
                            IBidProcesses processes
                            )
 {
     CommandContainer = commandContainer;
     _model           = model;
     _gameContainer   = gameContainer;
     _processes       = processes;
 }
 public ModeProcesses(XactikaVMData model,
                      XactikaDelegates delegates,
                      XactikaGameContainer gameContainer,
                      IBidProcesses bidProcesses,
                      IShapeProcesses shapeProcesses
                      )
 {
     _model          = model;
     _delegates      = delegates;
     _gameContainer  = gameContainer;
     _bidProcesses   = bidProcesses;
     _shapeProcesses = shapeProcesses;
 }
示例#6
0
        public void Init(XactikaVMData thisMod)
        {
            _tempMod    = thisMod.ShapeChoose1;
            _shapeList  = _tempMod !.PieceList;
            Margin      = new Thickness(10, 10, 10, 10);
            DataContext = _tempMod; // i think
            var thisBind = GetVisibleBinding(nameof(ChooseShapeObservable.Visible));

            SetBinding(VisibilityProperty, thisBind);               // i think
            _thisStack                    = new StackPanel();
            _thisStack.Orientation        = Orientation.Horizontal; // for this time, must be horizontal.
            _shapeList.CollectionChanged += ShapeList_CollectionChanged;
            Content = _thisStack;
            PopulateList();
        }
        public XactikaModeView(IEventAggregator aggregator, XactikaVMData model)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackPanel     stack = new StackPanel();
            ListChooserWPF list  = new ListChooserWPF();

            list.ItemHeight = 200;
            list.ItemWidth  = 600;
            Button button = GetGamingButton("Submit Game Option", nameof(XactikaModeViewModel.ModeAsync));

            button.FontSize = 150;
            stack.Children.Add(list);
            stack.Children.Add(button);
            Content = stack;
            list.LoadLists(model.ModeChoose1);
        }
        private readonly XactikaGameContainer _gameContainer; //if not needed, delete.

        public XactikaMainViewModel(CommandContainer commandContainer,
                                    XactikaMainGameClass mainGame,
                                    XactikaVMData viewModel,
                                    BasicData basicData,
                                    TestOptions test,
                                    IGamePackageResolver resolver,
                                    XactikaGameContainer gameContainer
                                    )
            : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
        {
            _model         = viewModel;
            _resolver      = resolver;
            _gameContainer = gameContainer;
            _model.Deck1.NeverAutoDisable        = true;
            _gameContainer.LoadBiddingAsync      = LoadBiddingAsync;
            _gameContainer.CloseBiddingAsync     = CloseBiddingAsync;
            _gameContainer.LoadShapeButtonAsync  = LoadShapeAsync;
            _gameContainer.CloseShapeButtonAsync = CloseShapeAsync;
        }
示例#9
0
        public void Init(XactikaVMData thisMod, IGamePackageResolver resolver)
        {
            SKSize           firstSize = new SKSize(60, 138);
            IProportionImage thisP     = resolver.Resolve <IProportionImage>("");

            _sizeUsed      = firstSize.GetSizeUsed(thisP.Proportion);
            _tempMod       = thisMod.ShapeChoose1;
            _shapeList     = _tempMod !.PieceList;
            Margin         = new Thickness(10, 10, 10, 10);
            BindingContext = _tempMod; // i think
            var thisBind = new Binding(nameof(ChooseShapeObservable.Visible));

            SetBinding(IsVisibleProperty, thisBind);                     // i think
            _thisStack                    = new StackLayout();
            _thisStack.Orientation        = StackOrientation.Horizontal; // for this time, must be horizontal.
            _shapeList.CollectionChanged += ShapeList_CollectionChanged;
            Content = _thisStack;
            PopulateList();
        }
示例#10
0
        public XactikaBidView(XactikaVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

            firstBid.Rows    = 2;
            firstBid.Columns = 5;
            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(XactikaBidViewModel.BidAsync));

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

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
示例#11
0
        public XactikaBidView(XactikaVMData model, IEventAggregator aggregator)
        {
            NumberChooserXF firstBid = new NumberChooserXF();

            firstBid.Rows    = 2;
            firstBid.Columns = 5;
            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 = GetGamingButton("Place Bid", nameof(XactikaBidViewModel.BidAsync));

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

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content     = grid;
            _aggregator = aggregator;
        }
示例#12
0
        public XactikaMainView(IEventAggregator aggregator,
                               TestOptions test,
                               XactikaVMData model,
                               IGamePackageRegister register,
                               StatsBoardCP boardCP
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            register.RegisterControl(_stats1.Element, "main");
            boardCP.LinkBoard();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF>();
            _shape1        = new ChooseShapeWPF();
            _trick1        = new SeveralPlayersTrickWPF <EnumShapes, XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF, XactikaPlayerItem>();

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

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


            _score.AddColumn("Cards Left", false, nameof(XactikaPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Bid Amount", false, nameof(XactikaPlayerItem.BidAmount));
            _score.AddColumn("Tricks Won", false, nameof(XactikaPlayerItem.TricksWon));
            _score.AddColumn("Current Score", false, nameof(XactikaPlayerItem.CurrentScore));
            _score.AddColumn("Total Score", false, nameof(XactikaPlayerItem.TotalScore));
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(XactikaMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(XactikaMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(XactikaMainViewModel.RoundNumber));
            firstInfo.AddRow("Mode", nameof(XactikaMainViewModel.GameModeText));
            StackPanel shapeStack = new StackPanel();

            shapeStack.Children.Add(_shape1);
            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(XactikaMainViewModel.ShapeScreen)
            };

            shapeStack.Children.Add(parent);
            Grid tempGrid = new Grid();

            AddAutoRows(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            AddAutoColumns(tempGrid, 2);
            StackPanel tempStack = new StackPanel();

            tempStack.Orientation = Orientation.Horizontal;
            tempStack.Children.Add(_trick1);
            tempStack.Children.Add(shapeStack);
            AddControlToGrid(tempGrid, tempStack, 0, 0);
            parent = new ParentSingleUIContainer()
            {
                Name = nameof(XactikaMainViewModel.BidScreen)
            };
            AddControlToGrid(tempGrid, parent, 0, 0); // if one is visible, then the other is not
            AddControlToGrid(tempGrid, _stats1, 0, 2);
            AddControlToGrid(tempGrid, _score, 0, 1);
            mainStack.Children.Add(tempGrid);
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);
            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
示例#13
0
        public XactikaMainView(IEventAggregator aggregator,
                               TestOptions test,
                               XactikaVMData model,
                               IGamePackageResolver resolver,
                               IGamePackageRegister register,
                               StatsBoardCP boardCP
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _resolver   = resolver;
            _aggregator.Subscribe(this);
            _shape1        = new ChooseShapeXF();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <XactikaCardInformation, XactikaGraphicsCP, CardGraphicsXF>();
            _trick1        = new SeveralPlayersTrickXF <EnumShapes, XactikaCardInformation, XactikaGraphicsCP, CardGraphicsXF, XactikaPlayerItem>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(XactikaMainViewModel.RestoreScreen));
            }
            register.RegisterControl(_stats1.Element, "main");
            boardCP.LinkBoard();
            _score.AddColumn("Cards Left", false, nameof(XactikaPlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Bid Amount", false, nameof(XactikaPlayerItem.BidAmount));
            _score.AddColumn("Tricks Won", false, nameof(XactikaPlayerItem.TricksWon));
            _score.AddColumn("Current Score", false, nameof(XactikaPlayerItem.CurrentScore));
            _score.AddColumn("Total Score", false, nameof(XactikaPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(XactikaMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(XactikaMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(XactikaMainViewModel.RoundNumber));
            firstInfo.AddRow("Mode", nameof(XactikaMainViewModel.GameModeText));
            StackLayout shapeStack = new StackLayout();

            shapeStack.Children.Add(_shape1);
            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(XactikaMainViewModel.ShapeScreen));

            parent.HorizontalOptions = LayoutOptions.Start;
            parent.VerticalOptions   = LayoutOptions.Start;
            shapeStack.Children.Add(parent);
            Grid tempGrid = new Grid();

            AddAutoRows(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            AddAutoColumns(tempGrid, 2);
            StackLayout tempStack = new StackLayout();

            tempStack.Orientation = StackOrientation.Horizontal;
            tempStack.Children.Add(_trick1);
            tempStack.Children.Add(shapeStack);
            AddControlToGrid(tempGrid, tempStack, 0, 0);
            parent = new ParentSingleUIContainer(nameof(XactikaMainViewModel.BidScreen));
            AddControlToGrid(tempGrid, parent, 0, 0); // if one is visible, then the other is not
            AddControlToGrid(tempGrid, _stats1, 0, 2);
            AddControlToGrid(tempGrid, _score, 0, 1); //problem is scoreboard.

            Grid finalGrid = new Grid();

            AddLeftOverRow(finalGrid, 1);
            AddLeftOverRow(finalGrid, 1);
            AddControlToGrid(finalGrid, tempGrid, 0, 0);
            AddControlToGrid(finalGrid, mainStack, 1, 0);

            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);
            //tempGrid.BackgroundColor = Color.Red;
            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;
        }
示例#14
0
 public BidProcesses(XactikaVMData model, XactikaGameContainer gameContainer)
 {
     _model         = model;
     _gameContainer = gameContainer;
 }
 public static int HowManyToBid(XactikaVMData model)
 {
     return(model.Bid1.NumberToChoose());
 }