Exemplo n.º 1
0
        public TeeItUpMainView(IEventAggregator aggregator,
                               TestOptions test,
                               TeeItUpVMData model,
                               TeeItUpGameContainer gameContainer
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _aggregator.Subscribe(this);
            _gameContainer          = gameContainer;
            _deckGPile              = new BaseDeckXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            _discardGPile           = new BasePileXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            _score                  = new ScoreBoardXF();
            _boardStack             = new StackLayout();
            _boardStack.Orientation = StackOrientation.Horizontal;
            _otherPile              = new BasePileXF <TeeItUpCardInformation, TeeItUpGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TeeItUpMainViewModel.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.
            otherStack.Children.Add(_otherPile);
            mainStack.Children.Add(otherStack);
            _score.AddColumn("Went Out", true, nameof(TeeItUpPlayerItem.WentOut), useTrueFalse: true);
            _score.AddColumn("Previous Score", true, nameof(TeeItUpPlayerItem.PreviousScore));
            _score.AddColumn("Total Score", true, nameof(TeeItUpPlayerItem.TotalScore));
            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(TeeItUpMainViewModel.NormalTurn));
            firstInfo.AddRow("Status", nameof(TeeItUpMainViewModel.Status));
            firstInfo.AddRow("Round", nameof(TeeItUpMainViewModel.Round));
            firstInfo.AddRow("Instructions", nameof(TeeItUpMainViewModel.Instructions));

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


            _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;
        }
Exemplo n.º 2
0
        private readonly TeeItUpGameContainer _gameContainer; //if not needed, delete.

        public TeeItUpMainViewModel(CommandContainer commandContainer,
                                    TeeItUpMainGameClass mainGame,
                                    TeeItUpVMData viewModel,
                                    BasicData basicData,
                                    TestOptions test,
                                    IGamePackageResolver resolver,
                                    TeeItUpGameContainer gameContainer
                                    )
            : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
        {
            _mainGame      = mainGame;
            _model         = viewModel;
            _gameContainer = gameContainer;
            _model.Deck1.NeverAutoDisable = true;
            _model.OtherPile !.SendEnableProcesses(this, () => _mainGame !.SaveRoot !.GameStatus != EnumStatusType.Beginning);
            LoadPlayerBoards(); //hopefully this simple (?)
        }
        private readonly TeeItUpGameContainer _gameContainer; //if we don't need it, take it out.

        public TeeItUpMainGameClass(IGamePackageResolver mainContainer,
                                    IEventAggregator aggregator,
                                    BasicData basicData,
                                    TestOptions test,
                                    TeeItUpVMData currentMod,
                                    IMultiplayerSaveState state,
                                    IAsyncDelayer delay,
                                    ICardInfo <TeeItUpCardInformation> cardInfo,
                                    CommandContainer command,
                                    TeeItUpGameContainer gameContainer)
            : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer)
        {
            _model         = currentMod;
            _command       = command;
            _gameContainer = gameContainer;
            _gameContainer.BoardClickedAsync = BoardClicked;
        }