Exemple #1
0
        private readonly DutchBlitzGameContainer _gameContainer; //if not needed, delete.

        public DutchBlitzMainViewModel(CommandContainer commandContainer,
                                       DutchBlitzMainGameClass mainGame,
                                       DutchBlitzVMData viewModel,
                                       BasicData basicData,
                                       TestOptions test,
                                       IGamePackageResolver resolver,
                                       DutchBlitzGameContainer gameContainer
                                       )
            : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
        {
            _mainGame      = mainGame;
            _model         = viewModel;
            _gameContainer = gameContainer;
            _model.Deck1.NeverAutoDisable = true;
            CanSendDrawMessage            = false;
        }
Exemple #2
0
 public DutchBlitzMainGameClass(IGamePackageResolver mainContainer,
                                IEventAggregator aggregator,
                                BasicData basicData,
                                TestOptions test,
                                DutchBlitzVMData currentMod,
                                IMultiplayerSaveState state,
                                IAsyncDelayer delay,
                                ICardInfo <DutchBlitzCardInformation> cardInfo,
                                CommandContainer command,
                                DutchBlitzGameContainer gameContainer
                                )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer)
 {
     _model         = currentMod;
     _command       = command;
     _gameContainer = gameContainer;
 }
Exemple #3
0
 public ComputerAI(DutchBlitzGameContainer gameContainer, DutchBlitzVMData model)
 {
     _moves         = 0;
     _gameContainer = gameContainer;
     _model         = model;
 }
Exemple #4
0
        public DutchBlitzMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  DutchBlitzVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile      = new BaseDeckWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>();
            _discardGPile   = new BasePileWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>();
            _score          = new ScoreBoardWPF();
            _public1.Width  = 700;
            _public1.Height = 500;
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

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


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_public1);
            otherStack.Children.Add(_score);
            _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft));
            _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound));
            _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame));
            mainStack.Children.Add(otherStack);



            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("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync));

            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);



            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status));
            firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage));
            otherStack.Children.Add(firstInfo.GetContent);


            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;

            otherStack.Children.Add(_yourDiscard);
            otherStack.Children.Add(_yourStock);
            mainStack.Children.Add(otherStack);
            _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.
            }
            Content = mainStack;
        }
Exemple #5
0
        public DutchBlitzMainView(IEventAggregator aggregator,
                                  TestOptions test,
                                  DutchBlitzVMData model
                                  )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);

            _deckGPile    = new BaseDeckXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>();
            _discardGPile = new BasePileXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>();
            _score        = new ScoreBoardXF();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

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

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            mainStack.Children.Add(_public1);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft));
            _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound));
            _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status));
            firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage));


            var button = GetGamingButton("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync));

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_yourDiscard);
            otherStack.Children.Add(_yourStock);
            otherStack.Children.Add(button);
            mainStack.Children.Add(otherStack);

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

            _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.
            }

            GamePackageViewModelBinder.ManuelElements.Clear();               //often times i have to add manually.

            DutchBlitzSaveInfo save = cons !.Resolve <DutchBlitzSaveInfo>(); //usually needs this part for multiplayer games.

            _score !.LoadLists(save.PlayerList);
            _discardGPile !.Init(_model.Pile1 !, "");  // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile(); // its the main one.

            _deckGPile !.Init(_model.Deck1 !, "");     // try here.  may have to do something else as well (?)
            _deckGPile.StartListeningMainDeck();
            _public1.Init(_model.PublicPiles1 !);
            _yourDiscard.Init(_model.DiscardPiles !, "");
            _yourStock.Init(_model.StockPile !.StockFrame, "");

            Content = mainStack;
        }