private readonly MilkRunGameContainer _gameContainer; //if not needed, delete.

        public MilkRunMainViewModel(CommandContainer commandContainer,
                                    MilkRunMainGameClass mainGame,
                                    MilkRunVMData viewModel,
                                    BasicData basicData,
                                    TestOptions test,
                                    IGamePackageResolver resolver,
                                    MilkRunGameContainer gameContainer
                                    )
            : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
        {
            _mainGame      = mainGame;
            _model         = viewModel;
            _gameContainer = gameContainer;
            _model.Deck1.NeverAutoDisable = true;
            _model.PlayerHand1.Maximum    = 8;
        }
 public MilkRunMainGameClass(IGamePackageResolver mainContainer,
                             IEventAggregator aggregator,
                             BasicData basicData,
                             TestOptions test,
                             MilkRunVMData currentMod,
                             IMultiplayerSaveState state,
                             IAsyncDelayer delay,
                             ICardInfo <MilkRunCardInformation> cardInfo,
                             CommandContainer command,
                             MilkRunGameContainer gameContainer,
                             ComputerAI ai
                             )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer)
 {
     _model                     = currentMod;
     _command                   = command;
     _gameContainer             = gameContainer;
     _ai                        = ai;
     _gameContainer.CanMakeMove = CanMakeMove;
 }
Example #3
0
        public MilkRunMainView(IEventAggregator aggregator,
                               TestOptions test,
                               MilkRunVMData model,
                               MilkRunGameContainer gameContainer
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer = gameContainer;
            _deckGPile     = new BaseDeckXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _playerHandWPF = new BaseHandXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();

            _opponentChocolateDeliveries  = new Label();
            _opponentChocolatePiles       = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _opponentStrawberryDeliveries = new Label();
            _opponentStrawberryPiles      = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _yourChocolateDeliveries      = new Label();
            _yourChocolatePiles           = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();
            _yourStrawberryDeliveries     = new Label();
            _yourStrawberryPiles          = new BasicMultiplePilesXF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsXF>();


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

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(MilkRunMainViewModel.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.
            AddPlayArea(otherStack);
            mainStack.Children.Add(otherStack);
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(MilkRunMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(MilkRunMainViewModel.Status));


            StackLayout newStack = new StackLayout();

            mainStack.Children.Add(newStack);
            newStack.HorizontalOptions = LayoutOptions.Center;
            newStack.Margin            = new Thickness(0, 10, 0, 0);
            newStack.Children.Add(_playerHandWPF);
            newStack.Children.Add(firstInfo.GetContent);



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