public CountdownMainView(IEventAggregator aggregator,
                                 TestOptions test, CountdownVMData model,
                                 CountdownGameContainer gameContainer
                                 )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);
            StackPanel mainStack = new StackPanel();

            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(CountdownMainViewModel.RestoreScreen)
                };
            }
            mainStack.Children.Add(_playerStack);
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _diceControl           = new DiceListControlWPF <CountdownDice>();
            otherStack.Children.Add(_diceControl);
            var endButton = GetGamingButton("End Turn", nameof(CountdownMainViewModel.EndTurnAsync));

            endButton.HorizontalAlignment = HorizontalAlignment.Left;
            otherStack.Children.Add(endButton);
            var otherButton = GetGamingButton("Show Hints", nameof(CountdownMainViewModel.Hint));

            otherButton.HorizontalAlignment = HorizontalAlignment.Left;
            otherStack.Children.Add(otherButton);
            mainStack.Children.Add(otherStack);

            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(CountdownMainViewModel.NormalTurn)); // there is no roll number needed for this game.
            firstInfo.AddRow("Round", nameof(CountdownMainViewModel.Round));     //if you don't need, it comment it out.
            firstInfo.AddRow("Status", nameof(CountdownMainViewModel.Status));


            mainStack.Children.Add(firstInfo.GetContent);



            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;
        }
 public PlayerBoardCP(CountdownGameContainer gameContainer, ISkiaSharpGameBoard thisElement, CountdownPlayerItem thisPlayer) : base(gameContainer.Resolver, thisElement)
 {
     _gameContainer = gameContainer;
     _thisPlayer    = thisPlayer; //i think here this time.  if i am wrong, rethink
     if (_gameContainer.GetNumberList == null)
     {
         throw new BasicBlankException("Nobody is handling get number list.  Rethink");
     }
     if (thisPlayer.NumberList.Count == 0)
     {
         thisPlayer.NumberList = _gameContainer.GetNumberList.Invoke();
     }
 }
Example #3
0
        public void LoadBoard(CountdownPlayerItem thisPlayer, CountdownGameContainer gameContainer)
        {
            _privateBoard = new PlayerBoardCP(gameContainer, Element, thisPlayer); //hopefully no problem.
            _aggregator   = gameContainer.Aggregator;
            SKSize thisSize = _privateBoard.SuggestedSize();

            WidthRequest      = thisSize.Width;
            VerticalOptions   = LayoutOptions.Start;
            HorizontalOptions = LayoutOptions.Start;
            HeightRequest     = thisSize.Height;
            EventAggregator thisT = Resolve <EventAggregator>();

            thisT.Subscribe(this, EnumRepaintCategories.FromSkiasharpboard.ToString());
            Content    = Element;
            _hasLoaded = true;
            Element.InvalidateSurface(); //i think
        }
Example #4
0
        public void LoadBoard(CountdownPlayerItem thisPlayer, CountdownGameContainer gameContainer)
        {
            _privateBoard = new PlayerBoardCP(gameContainer, Element, thisPlayer); //hopefully no problem.
            SKSize thisSize = _privateBoard.SuggestedSize();

            Width               = thisSize.Width;
            Height              = thisSize.Height;
            _aggregator         = gameContainer.Aggregator;
            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment   = VerticalAlignment.Top;
            EventAggregator thisT = Resolve <EventAggregator>();

            thisT.Subscribe(this, EnumRepaintCategories.FromSkiasharpboard.ToString()); //i think this is it.  if i am wrong, rethink
            Content    = Element;
            _hasLoaded = true;
            Element.InvalidateVisual(); //i think
        }
 public CountdownMainGameClass(IGamePackageResolver mainContainer,
                               IEventAggregator aggregator,
                               BasicData basicData,
                               TestOptions test,
                               CountdownVMData currentMod,
                               IMultiplayerSaveState state,
                               IAsyncDelayer delay,
                               CommandContainer command,
                               CountdownGameContainer gameContainer,
                               StandardRollProcesses <CountdownDice, CountdownPlayerItem> roller) :
     base(mainContainer, aggregator, basicData, test, currentMod, state, delay, command, gameContainer, roller)
 {
     _model   = currentMod; //if not needed, take this out and the _model variable.
     _command = command;
     gameContainer.MakeMoveAsync     = PrivateChooseNumberAsync;
     gameContainer.GetNumberList     = GetNewNumbers;
     CountdownVMData.CanChooseNumber = CanChooseNumber;
     _gameContainer = gameContainer;
     _roller        = roller;
 }