public void LoadControls(MonopolyCardGameVMData model)
        {
            _thisDetail          = model.AdditionalInfo1;
            Text                 = "Card Information";
            _thisDetail !.Change = this;
            Grid   tempGrid = new Grid();
            SKRect thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(tempGrid, thisRect); //i think.
            AddAutoColumns(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            _thisG                  = new CardGraphicsWPF();
            _thisLabel              = GetDefaultLabel();
            _thisLabel.Text         = _thisDetail.CurrentCard.Description;
            _thisLabel.TextWrapping = TextWrapping.Wrap;
            _thisG.SendSize("", _thisDetail.CurrentCard);
            AddControlToGrid(tempGrid, _thisG, 0, 0);
            _thisLabel.Margin = new Thickness(10, 3, 5, 3);
            AddControlToGrid(tempGrid, _thisLabel, 0, 1);
            Grid thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(tempGrid);
            Content = thisGrid;
        }
Exemplo n.º 2
0
 public TradePile(MonopolyCardGameGameContainer gameContainer, MonopolyCardGameVMData model, int player) : base(gameContainer.Command)
 {
     _gameContainer = gameContainer;
     _model         = model;
     GetPlayerIndex = player;
     AutoSelect     = EnumAutoType.None;
     _myID          = _gameContainer.PlayerList !.GetSelf().Id;
     Text           = "Trade " + player; //hopefully okay.
     Visible        = true;
 }
 public MonopolyCardGameMainViewModel(CommandContainer commandContainer,
                                      MonopolyCardGameMainGameClass mainGame,
                                      MonopolyCardGameVMData viewModel,
                                      BasicData basicData,
                                      TestOptions test,
                                      IGamePackageResolver resolver
                                      )
     : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
 {
     _mainGame = mainGame;
     _model    = viewModel;
     _model.Deck1.NeverAutoDisable      = true;
     CommandContainer.ExecutingChanged += CommandContainer_ExecutingChanged;
 }
        public void LoadControls(MonopolyCardGameVMData model)
        {
            _thisDetail          = model.AdditionalInfo1;
            Text                 = "Card Information";
            _thisDetail !.Change = this;
            Grid tempGrid = new Grid();

            HorizontalOptions = LayoutOptions.Start;
            SetUpMarginsOnParentControl(tempGrid); //i think.
            AddAutoColumns(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            _thisG          = new CardGraphicsXF();
            _thisLabel      = GetDefaultLabel();
            _thisLabel.Text = _thisDetail.CurrentCard.Description; //hopefully it wraps automatically since no option for it.
            _thisG.SendSize("", _thisDetail.CurrentCard);
            AddControlToGrid(tempGrid, _thisG, 0, 0);
            _thisLabel.Margin = new Thickness(10, 3, 5, 3);
            AddControlToGrid(tempGrid, _thisLabel, 0, 1);
            Grid thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(tempGrid);
            Content = thisGrid;
        }
Exemplo n.º 5
0
        public MonopolyCardGameMainView(IEventAggregator aggregator,
                                        TestOptions test,
                                        MonopolyCardGameVMData model,
                                        MonopolyCardGameGameContainer gameContainer
                                        )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);

            _deckGPile     = new BaseDeckWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>();
            _score         = new ScoreBoardWPF();
            _playerHandWPF = new BaseHandWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>();

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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(MonopolyCardGameMainViewModel.RestoreScreen)
                };
            }
            mainStack.Children.Add(_cardDetail);
            Grid finalGrid = new Grid();

            AddPixelColumn(finalGrid, 900);
            AddAutoColumns(finalGrid, 1);
            _tradeStack.Orientation = Orientation.Horizontal;
            AddControlToGrid(finalGrid, _tradeStack, 0, 1);
            AddControlToGrid(finalGrid, mainStack, 0, 0);
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            StackPanel tempStack = new StackPanel();
            var        thisBut   = GetGamingButton("Resume", nameof(MonopolyCardGameMainViewModel.ResumeAsync));

            tempStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Go Out", nameof(MonopolyCardGameMainViewModel.GoOutAsync));
            tempStack.Children.Add(thisBut);
            otherStack.Children.Add(tempStack);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Cards Left", true, nameof(MonopolyCardGamePlayerItem.ObjectCount)); //very common.
            _score.AddColumn("Previous Money", true, nameof(MonopolyCardGamePlayerItem.PreviousMoney), useCurrency: true);
            _score.AddColumn("Total Money", true, nameof(MonopolyCardGamePlayerItem.TotalMoney), useCurrency: true);
            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(MonopolyCardGameMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(MonopolyCardGameMainViewModel.Status));
            mainStack.Children.Add(_playerHandWPF);
            mainStack.Children.Add(firstInfo.GetContent);
            mainStack.Children.Add(_score);

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